BankCardTextField - 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 class BankCardTextField: TextFieldInput, AnyAppThemable, AccessibilitySupport

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

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 = BankCardTextField()
textField.text = "1111 2222 3333 4444"
textField.placeholder = "1111 2222 3333 4444"
textField.info = "Additional text"

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

Configure right view

You have the option to set any view on right side text field. For example, you can set camera button with icon in right view for interaction with camera.

textField.trailingView = UIView()

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.