ImageSource

Describes where an image comes from, without touching UIKit.
public readonly struct ImageSource

Properties

Kind

How Value should be resolved.

Type: ImageSourceKind

public ImageSourceKind Kind { get; }

Value

The symbol name, bundle asset name, or URL.

Type: string

public string Value { get; }

Methods

Bundle

An image from a bundle asset name.

public static ImageSource Bundle(
  string name)
ParameterSummary
string nameThe name of the asset in the bundle.

Returns

  • ImageSource: An image source configured for a bundle asset.

Data

An image from raw encoded bytes.

public static ImageSource Data(
  byte[] bytes)
ParameterSummary
byte bytesThe encoded image data.

Returns

  • ImageSource: An image source configured for in-memory data.

Symbol

An image from an SF Symbol name.

public static ImageSource Symbol(
  string name)
ParameterSummary
string nameThe name of the system symbol.

Returns

Url

An image from a remote URL, loaded asynchronously.

Supported by Image.Source and sharing. Compact control icons accept local sources only.

public static ImageSource Url(
  string url)
ParameterSummary
string urlThe full web address of the image.

Returns

Operators

Implicit ImageSource(string)

Treats a string as a URL when it looks like one, otherwise resolves it automatically.

public static implicit operator ImageSource(
  string value)
ParameterSummary
string valueThe string value to convert.

Returns