VGSTextField

public class VGSTextField : UIView
extension VGSTextField: UITextFieldDelegate

An object that displays an editable text area in user interface.

UI Attributes

  • Textfield placeholder string.

    Declaration

    Swift

    public var placeholder: String? { get set }
  • Textfield autocapitalization type. Default is .sentences.

    Declaration

    Swift

    public var autocapitalizationType: UITextAutocapitalizationType { get set }
  • Textfield spell checking type. Default is UITextSpellCheckingType.default.

    Declaration

    Swift

    public var spellCheckingType: UITextSpellCheckingType { get set }
  • Textfield attributedPlaceholder string.

    Declaration

    Swift

    public var attributedPlaceholder: NSAttributedString? { get set }
  • The natural size for the Textfield, considering only properties of the view itself.

    Declaration

    Swift

    public override var intrinsicContentSize: CGSize { get }
  • UIEdgeInsets for text and placeholder inside VGSTextField.

    Declaration

    Swift

    public var padding: UIEdgeInsets { get set }
  • The technique to use for aligning the text.

    Declaration

    Swift

    public var textAlignment: NSTextAlignment { get set }
  • Sets when the clear button shows up. Default is UITextField.ViewMode.never

    Declaration

    Swift

    public var clearButtonMode: UITextField.ViewMode { get set }
  • Identifies whether the text object should disable text copying and in some cases hide the text being entered. Default is false.

    Declaration

    Swift

    public var isSecureTextEntry: Bool { get set }
  • Indicates whether VGSTextField should automatically update its font when the device’s UIContentSizeCategory is changed.

    Declaration

    Swift

    public var adjustsFontForContentSizeCategory: Bool { get set }
  • Input Accessory View

    Declaration

    Swift

    public var keyboardAccessoryView: UIView? { get set }
  • Determines whether autocorrection is enabled or disabled during typing.

    Declaration

    Swift

    public var autocorrectionType: UITextAutocorrectionType { get set }

Accessibility Attributes

  • A succinct label in a localized string that identifies the accessibility text field.

    Declaration

    Swift

    public var textFieldAccessibilityLabel: String? { get set }
  • A localized string that contains a brief description of the result of performing an action on the accessibility text field.

    Declaration

    Swift

    public var textFieldAccessibilityHint: String? { get set }
  • Boolean value that determinates if the text field should be exposed as an accesibility element.

    Declaration

    Swift

    public var textFieldIsAccessibilityElement: Bool { get set }

Functional Attributes

Manage input

  • Set textfield default text.

    Note

    This will not change State.isDirty attribute.
    • Discussion: probably you should want to set field configuration before setting default value, so the input format will be update as required.

    Declaration

    Swift

    public func setDefaultText(_ text: String?)
  • Removes input from field.

    Declaration

    Swift

    public func cleanText()

Compare Input

  • Check if input text in two textfields is same. Returns Bool.

    Note

    Result will be based on raw text, mask and dividers will be ignored.

    Declaration

    Swift

    public func isContentEqual(_ textField: VGSTextField) -> Bool

Text Attribute

  • VGSTextField text font

    Declaration

    Swift

    var font: UIFont? { get set }
  • VGSTextField text color

    Declaration

    Swift

    @IBInspectable
    var textColor: UIColor? { get set }

UI Layer Attribute

UIResponder methods