CreationKit Documentation

Class Input​Field

public class InputField<InputView: TextInputable>: UIView  

An InputField is a view where a user can input text. This type is generic to allow multiple types of inputs, such as from a textfield with a keyboard, or a a simple label with an action sheet. This type shouldn't generally be used directly. You should prefer to use one of it's subclasses.

InputField InputField UIView UIView InputField->UIView

Conforms To

UIView

Initializers

init(input​View:​)

public init(inputView: InputView)  

Properties

text

public var text: String?  

The current text the input field has.

placeholder

public var placeholder: String!  

The placeholder text of the input field.

error​Message

public var errorMessage: String? 

An error message for the input. If this string is nil, a message won't be displayed, other it will be displayed when an error occurs in the input field. Defaults to nil.

helper​Text

public var helperText: String?  

Text that provides additional context beyond the label.

is​Highlighted

public var isHighlighted: Bool = false  

true if the input field is currently focused on.

max​Characters

public var maxCharacters: UInt = 0  

A max character count for the input. Default value is zero, which indicates unlimited characters.

animation​Duration

public var animationDuration: TimeInterval = 0.2

The animation duration for any animations the input field makes, such as when it transitions from normal to highlighted.

state

public var state: InputFieldState = .normal  

The current state of the input field

right​Accessory​View​Size

@objc public var rightAccessoryViewSize: CGSize  

right​Accessory​View

@objc public var rightAccessoryView: UIView?  

An accessory view that is displayed on the right side of the input field.