OTPTextField SwiftUI - admiral-team/admiralui-ios GitHub Wiki

Struct

An object that displays an editable text area for enter sms code


Declaration

public struct OTPTextField: TextFieldInput, AccessabilitySupportUIKit, Identifiable

Overview

The login/password or SMS code entry field, a sufficient number of component states allows you to independently set the rules for entering data into the input.

There are for available states:

  • normal
  • error
  • disabled
  • readOnly

Live example

Configure a OTPTextField

Text field may be in three state.

Default

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

OTPTextField(
    .constant("Text"),
    placeholder: "Placeholder",
    state: .constant(.noraml)
)

Error

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

OTPTextField(
    .constant("Text"),
    placeholder: "Placeholder",
    state: .constant(.error)
)

Disabled

The disabled state disable user input and hide input text.

OTPTextField(
    .constant("Text"),
    placeholder: "Placeholder",
    state: .constant(.diabled)
)

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.