I am trying to integrate the undo / redo functions into a UITextView (I am creating a LateX editor) with no luck, and to be honest, I'm really confused by this argument. I do not understand the steps associated with these two operations, I mean, I need two methods
- one to delete the last inserted text
- one to restore deleted text.
Is there any doubt when I get the last inserted text? in other words, where should I register for cancellation?
- in textViewDidChange I can get all the text
- in textViewShouldChangeTextInRange I can get the last char inserted
I know that what I wrote was not the best explanation, but I hope that someone here has encountered the same problem in the past and can give me a hint. Basically, to resume, I have to add undo / redo functions to the text view, possibly with two buttons associated with these actions.
Thanks in advance
ios cocoa-touch uitextview uitextviewdelegate nsundomanager
elio.d
source share