VisualItemRepresentable

public protocol VisualItemRepresentable

Able to represent an Item in the PresentVisualAction.

  • id Default implementation

    The optional ID that identifies this Item, usually read from the attributes.

    Default Implementation

    Declaration

    Swift

    var id: String?
  • requiresStore Default implementation

    Whether this Item needs to store its value in a store or not, if this Item generates (or asks input from the user) and needs to save it for either validation of sending to the server.

    Default Implementation

    Declaration

    Swift

    var requiresStore: Bool
  • initialStoreValue Default implementation

    The initial value to use in the Store, usually this is read from a attribute if exists otherwise this should return the default value.

    Default Implementation

    Declaration

    Swift

    var initialStoreValue: VisualInputValue?
  • validateValue(value:) Default implementation

    Check if the given value is a valid one for this item.

    Default Implementation

    Declaration

    Swift

    func validateValue(value: VisualInputValue?) -> (Bool, PayloadValidationError?)
  • payload(for:) Default implementation

    The final value serialized

    Default Implementation

    Declaration

    Swift

    func payload(for value: VisualInputValue) -> String?
  • required Default implementation

    Is this value required (only applies to fields that require a store )

    Default Implementation

    Declaration

    Swift

    var required: Bool
  • label Default implementation

    Label of the field (to be rendered)

    Default Implementation

    Declaration

    Swift

    var label: String