OTPTextField - admiral-team/admiralui-ios GitHub Wiki

Class

An object that displays an editable text area in your interface. It serves for enter sms code.


Declaration

public class OTPTextField: TextFieldInput, AnyAppThemable, AccessibilitySupport

Overview

Alignment text of input text is center. Text field serves for entering sms code.

Live example

Configure a Text Field

Configuration a text field the similar UITextField. This example show how set text for input text, text for placeholder and text for helper text label.

let textField = OTPTextField()
textField.text = "1234"
textField.placeholder = "Sms code"
textField.info = "Info"

Text field may be in three state.

Default

The normal state of the field in which the user can edit textfield

textField.state = .normal

Error

The error state is useful to show the user an error.

textField.state = .error

Disabled

The disabled state disable user input and hide input text.

textField.state = .disabled

Handle changing text

Handling text in text field the similar UITextField. Need set delegate

textField.delegate = self

After you can implementation methods from protocol TextFieldInputDelegate.

Contribution

You can help us to find bugs or ask us to add features.

  • To start issue please use ready-made templates.
  • To make changes to the repository, you need to create a fork of the project, make changes to the code and create a pull request in our project. You can read more about this in the Github documentation.