Avatar ·

How to add placeholder text in UITextView in Swift?

Hi everyone! I'm new to Swift and iOS development. I'm trying to create a text input screen similar to iOS Notes, where UITextView has a gray hint text "Enter text..." that disappears when the user starts typing and reappears if the field is empty. UITextField has a `placeholder` property that does this automatically, but UITextView doesn't have such a property. I tried using `UITextViewDelegate` and the `textViewDidChange` method to manually manage the placeholder text display, but I ran into issues: 1. When I set the placeholder text via `textView.text = "Enter text..."`, it doesn't disappear when the user starts typing — the text just gets appended to the placeholder. 2. If I try to clear the text in `textViewDidBeginEditing`, th