InsetTextField

@IBDesignable
class InsetTextField : UITextField

A UITextField with settable insets

  • Expose horizontal inset

    Declaration

    Swift

    @IBInspectable
    var hInset: CGFloat
  • Expose vertical inset

    Declaration

    Swift

    @IBInspectable
    var vInset: CGFloat
  • Return text rect

    Declaration

    Swift

    override func textRect(forBounds bounds: CGRect) -> CGRect

    Parameters

    bounds

    Field bounds

    Return Value

    Inset bounds

  • Return editing rect

    Declaration

    Swift

    override func editingRect(forBounds bounds: CGRect) -> CGRect

    Parameters

    bounds

    Field bounds

    Return Value

    Inset bounds

  • Return placeholder rect

    Declaration

    Swift

    override func placeholderRect(forBounds bounds: CGRect) -> CGRect

    Parameters

    bounds

    Field bounds

    Return Value

    Inset bounds

  • Return left view rect

    Declaration

    Swift

    override func leftViewRect(forBounds bounds: CGRect) -> CGRect

    Parameters

    bounds

    Field bounds

    Return Value

    Inset bounds

  • Return clear button rect

    Declaration

    Swift

    override func clearButtonRect(forBounds bounds: CGRect) -> CGRect

    Parameters

    bounds

    Field bounds

    Return Value

    Inset bounds

  • Return right view rect

    Declaration

    Swift

    override func rightViewRect(forBounds bounds: CGRect) -> CGRect

    Parameters

    bounds

    Field bounds

    Return Value

    Inset bounds

  • Fill and disable

    Declaration

    Swift

    func disable(text: String)

    Parameters

    text

    Text to fill with