AssetProtocol
public protocol AssetProtocol : FlatResource
A simple protocol to bridge Contentful.Asset and other formats for storing asset information.
-
String representation for the URL of the media file associated with this asset.
Declaration
Swift
var urlString: String? { get } -
url(with:Extension method) 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 throwSDKErrorif the SDK is unable to generate a valid URL with the desired ImageOptions.Declaration
Swift
func url(with imageOptions: [ImageOption] = []) throws -> URLParameters
imageOptionsAn array of
ImageOptionthat will be used for server side manipulations.Return Value
The URL for the image with the image manipulations, represented in the
imageOptionsparameter, applied.
View on GitHub
AssetProtocol Protocol Reference