Link
public enum Link
A representation of Linked Resources that a field may point to in your content model.
This stateful type safely highlights links that have been resolved to Entries, Assets, or if they are
still unresolved. If your data model conforms to ContentModellable or EntryModellable you can also use the at method
to extract an instance of your linked type.
-
Undocumented
Declaration
Swift
public enum Link -
Extract the concrete type conforming to ContentModellable which the specified field points to.
Declaration
Swift
public static func at<ValueType: ContentModellable>(_ fieldName: String, in fields: [String: Any], linkDepth: Int) -> ValueType?Parameters
fieldNameThe name of the field where there is a linked Resource.
linkDepthInterally used by the SDK to prevent infinite loops when resolving links.
Return Value
Intance of concrete type conforming to
ContentModellablethat is Linked.
-
The Link is unresolved, and therefore contains a dictionary of metadata describing the linked resource.
Declaration
Swift
case unresolved(LinkSys)
View on GitHub
Link Enum Reference