Irrespective of where the textview has been tapped (iOS), I want that the cursor position is at the end of the string. How can I move the cursor there?
How to get UITextView cursor to end of string?
let endPosition = textField.endOfDocument
textField.selectedTextRange = textField.textRange(from: endPosition, to: endPosition)Everything seem well explained here.
h ttps://stackoverflow.com/questions/34922331/getting-and-setting-cursor-position-of-uitextfield-and-uitextview-in-swift
I went through that stackoverflow post prior to posting. I do not want to select the text. Its a textarea that displays numbers. i want that when its selected the cursor should be at the end. Also, it should be possible for the user to drag the cursor, should the user's need be.
You do not select. By havinbg the start and end of selection at the same end position, it should just show a cursor at the end, no selection.
Isn't it what you look for ?
Precisely! Thank you.