UITextField

  • SwifterSwift: UITextField text type.

    • emailAddress: UITextField is used to enter email addresses.
    • password: UITextField is used to enter passwords.
    • generic: UITextField is used to enter generic text.
    See more

    Declaration

    Swift

    public enum TextType
  • SwifterSwift: Set textField for common text types.

    Declaration

    Swift

    public var textType: TextType
  • SwifterSwift: Check if text field is empty.

    Declaration

    Swift

    public var isEmpty: Bool
  • SwifterSwift: Return text with no spaces or new lines in beginning and end.

    Declaration

    Swift

    public var trimmedText: String?
  • SwifterSwift: Check if textFields text is a valid email format.

    textField.text = "[email protected]"
    textField.hasValidEmail -> true
    
    textField.text = "swifterswift"
    textField.hasValidEmail -> false
    

    Declaration

    Swift

    public var hasValidEmail: Bool
  • SwifterSwift: Left view tint color.

    Declaration

    Swift

    @IBInspectable public var leftViewTintColor: UIColor?
  • SwifterSwift: Right view tint color.

    Declaration

    Swift

    @IBInspectable public var rightViewTintColor: UIColor?
  • SwifterSwift: Clear text.

    Declaration

    Swift

    public func clear()
  • SwifterSwift: Set placeholder text color.

    Declaration

    Swift

    public func setPlaceHolderTextColor(_ color: UIColor)

    Parameters

    color

    placeholder text color.

  • SwifterSwift: Add padding to the left of the textfield rect.

    Declaration

    Swift

    public func addPaddingLeft(_ padding: CGFloat)

    Parameters

    padding

    amount of padding to apply to the left of the textfield rect.

  • SwifterSwift: Add padding to the left of the textfield rect.

    Declaration

    Swift

    public func addPaddingLeftIcon(_ image: UIImage, padding: CGFloat)

    Parameters

    image

    left image

    padding

    amount of padding between icon and the left of textfield