FormAction

public struct FormAction

A FormAction describing the form and and its fields.

  • Initializes the form action from its elements.

    Declaration

    Swift

    public init(title: String, fields: [FormField])

    Parameters

    id

    the identifier for this action

    title

    the form title

    fields

    the form’s fields, at least one field must be of type submit.

  • Creates a form action from attributes.

    Attributes are expected to include:

    • title a simple string containing the title of the form.

    • inputs an array of inputs, it’s ok to include the submit button as a FormField: but they will be discarded and only the the title of the 1st button will be used as the actionTitle.

    Declaration

    Swift

    public init?(id: String, attributes: AnyObject?)

    Parameters

    id

    the form id

    attributes

    form attributes