Asset

public class Asset: LocalizableResource

An asset represents a media file in Contentful

  • URL of the media file associated with this asset. Optional for compatibility with select operator queries. Also, If the media file is still being processed, as the final stage of uploading to your space, this property will be nil.

    Declaration

    Swift

    public var urlString: String?
  • The title of the asset. Optional for compatibility with select operator queries.

    Declaration

    Swift

    public var title: String?
  • Description of the asset. Optional for compatibility with select operator queries.

    Declaration

    Swift

    public var description: String?
  • Metadata describing the file associated with the asset. Optional for compatibility with select operator queries.

    Declaration

    Swift

    public var file: FileMetadata?
  • Undocumented

    See more

    Declaration

    Swift

    public class Asset: LocalizableResource
  • The URL for the underlying media file

    Declaration

    Swift

    public func url() throws -> URL
  • The URL for the underlying media file with additional options for server side manipulations such as format changes, resizing, cropping, and focusing on different areas including on faces, among others.

    Throws

    Will throw SDKError if the SDK is unable to generate a valid URL with the desired ImageOptions.

    Declaration

    Swift

    public func url(with imageOptions: [ImageOption] = []) throws -> URL

    Parameters

    imageOptions

    An array of ImageOption that will be used for server side manipulations.