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.

  • id

    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

    fieldName

    The name of the field where there is a linked Resource.

    linkDepth

    Interally used by the SDK to prevent infinite loops when resolving links.

    Return Value

    Intance of concrete type conforming to ContentModellable that is Linked.

  • The Link is unresolved, and therefore contains a dictionary of metadata describing the linked resource.

    Declaration

    Swift

    case unresolved(LinkSys)