How to clear UITextView upon editing?
Looks like you're not setting your UITextView
's delegate
.
class ViewController: UIViewController, UITextViewDelegate {
@IBOutlet weak var myTextView: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
myTextView.delegate = self
}
func textViewDidBeginEditing(textView: UITextView) {
myTextView.text = String()
}
UITextViewDelegate Protocol Reference