FormField

@available(*, deprecated, renamed: "MessageFormItem", message: "This method is deprecated in 4.21.0")
@objc(SBDFormField)
open class FormField : NSObject, Codable, NSCopying

Input field data information.

Since

4.14.1
  • Unique key of field

    Declaration

    Swift

    @objc
    public let fieldKey: String
  • Title

    Declaration

    Swift

    @objc
    public let title: String
  • Input type

    Declaration

    Swift

    @objc
    public let inputTypeValue: String
  • Indicate whether the field is required or not

    Declaration

    Swift

    @objc
    public let required: Bool
  • Regular expressions for validation

    Declaration

    Swift

    @objc
    public let regex: String?
  • Placeholder

    Declaration

    Swift

    @objc
    public let placeholder: String?
  • Field to store the data to be submitted. Memory-cache reserved property for answer.

    Declaration

    Swift

    @objc
    public var temporaryAnswer: String?
  • constructor

    Declaration

    Swift

    @objc
    public init(
        fieldKey: String,
        title: String,
        inputTypeValue: String,
        required: Bool,
        regex: String? = nil,
        placeholder: String? = nil
    )
  • Default constructor.

    Declaration

    Swift

    required public init(from decoder: Decoder) throws

    Parameters

    decoder

    Decoder instance

  • Encodes this object.

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    Encoder instance

  • Copies this object

    Declaration

    Swift

    public func copy(with zone: NSZone? = nil) -> Any

    Parameters

    zone

    optional NSZone

    Return Value

    FormField instance

utils

  • Input type value

    Declaration

    Swift

    @objc
    public var inputType: InputType { get }
  • Returns whether it matches the regular expression.

    Declaration

    Swift

    @objc
    public var isValid: Bool { get }
  • Returns whether the field is in a submittable state

    Declaration

    Swift

    @objc
    public var isSubmittable: Bool { get }
  • The enum type to represent the input type of a feild key. NOTE: The default value is ‘text’.

    Since

    4.14.1
    See more

    Declaration

    Swift

    @objc(SBDFormInputType)
    public enum InputType : Int
    extension FormField.InputType: RawRepresentable