UIForm
open class UIForm
A wrapper class for an HTML form.
-
The HTML form that is the base of the class
Declaration
Swift
public let form = UIElement(element: .form) -
Creates a form with a label and input for each item.
Declaration
Swift
public init(with items: [String], idPrefix: String? = nil, submitText: String, and action: String? = nil)Parameters
itemsThe items that will be used for each label/input combonation for the form.
idPrefixThe prefix for the id’s for the wrappr divs, inputs and labels. This defaults for
nil.submitTextThe text for the submission button.
actionThe path that the data will be sent to at form submission.
-
Creates a form for loging in a user.
Declaration
Swift
public class func loginForm(with login: LoginFormType, and action: String) -> UIFormParameters
loginThe login that will be used to authenticate the user. This could be an email or username.
actionThe path that the data will be sent to at form submission.
Return Value
A
UIFormfor authenticating a user. -
Creates a basic form for signing up a user.
Declaration
Swift
public class func signUpForm(with action: String, and idPrefix: String = "user") -> UIFormParameters
actionThe path that the data will be sent to at form submission.
idPrefixThe prefix for the element’s ids. This defaults to “user”.
Return Value
The
UIFormthat contains the HTML form that will be submited on submission. -
The top level element of the class. In this case, it is the form property.
Declaration
Swift
public var topElement: UIElement
UIForm Class Reference