CreationKit Documentation

Class Text​Field​Input

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.

TextFieldInput TextFieldInput InputField<PlaceholderTextField> InputField<PlaceholderTextField> TextFieldInput->InputField<PlaceholderTextField> MaskedTextFieldDelegateListener MaskedTextFieldDelegateListener TextFieldInput->MaskedTextFieldDelegateListener

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

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

input​Mask

public var inputMask: Mask?  

The input mask to apply to the textfield. Defaults to nil and won't mask.

keyboard​Type

public var keyboardType: UIKeyboardType = .default  

read​Only

public var readOnly: Bool = false

did​Begin​Editing

public var didBeginEditing: AnyPublisher<Void, Never>  

A Publisher that is fired when the textfield becomes the first responder.

did​End​Editing

public var didEndEditing: AnyPublisher<Void, Never>  

A Publisher that is fired when the textfield resigns its first responder status.

editing​Changed

public var editingChanged: AnyPublisher<String?, Never>  

A Publisher that is fired when the textfield text changes.

Methods

text​Field​Should​Return(_:​)

public func textFieldShouldReturn(_ textField: UITextField) -> Bool  

text​Field​Should​Begin​Editing(_:​)

public func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool