Class
TextFieldInput
public final class TextFieldInput: InputField<PlaceholderTextField>, MaskedTextFieldDelegateListener
An InputField generic over a PlaceholderTextField.
This textfield will automatically update itself to show a placeholder when it's text property is set to nil.
This field could be used by itself. If you need a title or subtitle with this input form, it's probably more useful to use a
TextInputFormLayout as it contains support for the title and subtitle.
TextInputFormLayout
is the type CreationKit uses internally for it's Forms.
Relationships
Conforms To
InputField<PlaceholderTextField>
MaskedTextFieldDelegateListener
Initializers
init(text:placeholder:)
public convenience init(
text: String?, placeholder: String = kTextInputFieldDefaultPlaceholder)
Create a new TextFieldInput with optional text and a placeholder.
Parameters
Name | Type | Description |
---|---|---|
text | String? |
The text to fill the input field with. Defaults to nil. |
placeholder | String |
The placeholder text to display when the text property is nil. |
Properties
inputMask
public var inputMask: Mask?
The input mask to apply to the textfield. Defaults to nil and won't mask.
keyboardType
public var keyboardType: UIKeyboardType = .default
readOnly
public var readOnly: Bool = false
didBeginEditing
public var didBeginEditing: AnyPublisher<Void, Never>
A Publisher that is fired when the textfield becomes the first responder.
didEndEditing
public var didEndEditing: AnyPublisher<Void, Never>
A Publisher that is fired when the textfield resigns its first responder status.
editingChanged
public var editingChanged: AnyPublisher<String?, Never>
A Publisher that is fired when the textfield text changes.
Methods
textFieldShouldReturn(_:)
public func textFieldShouldReturn(_ textField: UITextField) -> Bool
textFieldShouldBeginEditing(_:)
public func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool