FWTextModel

struct FWTextModel : FWComponentModel
extension FWTextModel: Equatable

A text component data struct. Title is the only required value for initialising.

  • id

    The UUID of the component.

    Declaration

    Swift

    var id: String
  • The title of the component.

    Declaration

    Swift

    var title: String
  • A description or subtitle for the component

    Declaration

    Swift

    var description: String
  • A Boolean value that determines if the component is required to be filled or not.

    Declaration

    Swift

    var required: Bool
  • A custom regular expression for the component’s text field validation. Only valid if validator attribute is set to “custom”.

    Declaration

    Swift

    var regex: String
  • Component’s text field placeholder string.

    Declaration

    Swift

    var placeholder: String
  • Component Specific Type

    Declaration

    Swift

    var type: FWComponentModelWrapper.Types
  • Creates a new instance by decoding from the given decoder.

    This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

    Throws

    Error decoding the data transfer object.

    Declaration

    Swift

    init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder to read data from.

  • Encodes this value into the given encoder.

    If the value fails to encode anything, encoder will encode an empty keyed container in its place. This function throws an error if any values are invalid for the given encoder’s format.

    Throws

    Error encoding the data transfer object.

    Declaration

    Swift

    func encode(to encoder: Encoder) throws

    Parameters

    encoder

    The encoder to write data to.