Form

@available(*, deprecated, renamed: "MessageForm", message: "This method is deprecated in 4.21.0")
@objc(SBDForm)
open class Form : NSObject, Codable, NSCopying

Form data

Since

4.14.1
  • Unique key of form.

    Declaration

    Swift

    @objc
    public let formKey: String
  • Indicates the input field data information array.

    Declaration

    Swift

    @objc
    public let fields: [FormField]
  • Indicates field data values that have been stored.

    Declaration

    Swift

    @objc
    public let answers: [FormFieldAnswer]?
  • constructor

    Declaration

    Swift

    @objc
    public init(
        formKey: String,
        fields: [FormField],
        answers: [FormFieldAnswer]? = nil
    )
  • Default constructor.

    Declaration

    Swift

    public required 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

    Form instance

utils

  • Indicates that the form data has already been submitted.

    Declaration

    Swift

    @objc
    public var isSubmitted: Bool { get }
  • Indicates that the form data can be submitted.

    Declaration

    Swift

    @objc
    public var canSubmit: Bool { get }

    Return Value

    If true, can be submitted NOTE: You MUST store the value entered by user interaction in the temporaryAnswer.