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

Class

An object that displays an editable text area in your interface. It serves for entering bank card.


Declaration

public struct BankCardTextField<T>: TextFieldInput, AccessabilitySupportUIKit, Identifiable where T: View

Overview

Text field serves for entering bank card number. Text field contains input text, placeholder, input text, helper text or error message, right view.

Live example

Configure a Text Field

BankCardTextField(
     value: .constant(""1111 2222 3333 4444""),
     placeholder: "1111 2222 3333 4444",
     info: .constant("Additional text")
)

Text field may be in three state.

Default

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

BankCardTextField(
 state: .normal
)

Error

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

BankCardTextField(
 state: .error
)

Disabled

The disabled state disable user input and hide input text.

BankCardTextField(
 state: .disabled
)

Configure a text field with text formatter

BankCardTextField(
     value: .constant("Text"),
     formatter: BlocFormatter(format: { value in
         return "text" + value
     }
)

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.