If I have a UITextView with the following text:
"Please finish this sent..."
And the aim is to allow the user to edit the textview so that they can finish the sentence, how can I make it so that they can't remove the text that was there before they start editing aka "Please finish this sent"?
UPDATE: I have been able to make it so that users cannot remove the initial text, but is there any way to make it so that they cannot type before the initial text or inside it? Thanks for everyone who has answered so far!
UPDATE: Solved. To stop people editing before and inside the string I simply added
if range.location == 0 {
return false
}
if (0 < range.location && range.location < count(string.utf16)) == true {
return false
}
to the shouldChangeTextInRange function. Thanks everyone for the help!