RVS_PlaceholderTextView
@MainActor
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 a placeholder text label for the text view (which doesn’t naturally have one).
Declaration
Swift
@MainActor public let placeholderLabel: UILabel
-
This is the string that is displayed in the placeholder label. Default is empty.
Declaration
Swift
@IBInspectable @MainActor 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 @MainActor public var useSystemFont: Bool { get set }
-
When we do our layout, we add the placeholder view.
Declaration
Swift
@MainActor override func layoutSubviews()