PUUnderlineTextField

@IBDesignable
open class PUUnderlineTextField : PUBaseTextField

PowerUpSwift: The subclass of PUBaseTextField that allows the editing of additional UIKit properties via the Interface Builder. This text field displays a bottom bar that appears like an underline. PUUnderlineTextField Demo

Attributes inspector

Attributes inspector

Inspectables

  • PowerUpSwift: The main color for the underline. Defaults to .lightGray.

    Declaration

    Swift

    @IBInspectable
    open var underlineColor: UIColor
  • PowerUpSwift: The height of the underline. Defaults to 1.

    Declaration

    Swift

    @IBInspectable
    open var underlineHeight: CGFloat
  • PowerUpSwift: Enables or disables the highlight behavior when the text field is being focused on (first responder). Defaults to false.

    Declaration

    Swift

    @IBInspectable
    open var isHighlightOn: Bool
  • PowerUpSwift: The color of the underline when the text field is being focused on (first responder). Defaults to UIView().tintColor.

    Declaration

    Swift

    @IBInspectable
    open var highlightColor: UIColor
  • PowerUpSwift: The color of the underline when isShowingError is true. Defaults to .red.

    Declaration

    Swift

    @IBInspectable
    open var errorColor: UIColor

Properties

  • PowerUpSwift: Defaults to false.

    Declaration

    Swift

    open var isShowingError: Bool

Custom Functions

  • PowerUpSwift: Sets the color of the underline to the specified error color and sets the property isShowingError to true.

    Declaration

    Swift

    open func showErrorColor()
  • PowerUpSwift: Removes the error color of the underline and sets the property isShowingError to false.

    • The underline color is set to the specified highlight color if it’s the first responder and if isHighlightOn is enabled.
    • Otherwise, the underline gets set back to its original color.

    Declaration

    Swift

    open func hideErrorColor()