RVS_PlaceholderTextView

public class RVS_PlaceholderTextView : UITextView

This is a subclass of the standard UITextView class.

It adds the ability to provide a “placeholder,” in the same manner as the UITextField class.

In this class, a label is displayed, with the placeholder text, and that label is only displayed when there is no text in the view.

  • This is the string that is displayed in the placeholder label. Default is empty.

    Declaration

    Swift

    @IBInspectable
    public var placeholder: String { get set }
  • If this is true, then the placeholder is displayed in the system font (sized for the view font). Default is true.

    Declaration

    Swift

    @IBInspectable
    public var useSystemFont: Bool { get set }

Base Class Overrides

  • When we do our layout, we add the placeholder view.

    Declaration

    Swift

    override func layoutSubviews()