0

Can someone show me how to move the textView cursor downward cause I don't know how to do it, Also where should I put it in the textViewDidBeginEditing(_ textView: UITextView) or in the textViewDidEndEditing(_ textView: UITextView) Thanks in advance

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Somebody
  • 67
  • 1
  • 9

1 Answers1

1

This will move coursor to the end of text:

 func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
        DispatchQueue.main.async {
            textView.selectedRange = NSRange(location: textView.text.count, length: 0)
        }
        return true
    }

If you want to begin text from a new line, add this, before return true:

textView.text = textView.text + "\n"

If you want to skip two lines, make it "\n\n", and so on.

David
  • 857
  • 1
  • 11
  • 25