I am having quite a issue trying to change the cut/copy/paste behavior of the UITextView
.
What I want to achieve is: detect when the user has pasted some text into the UITextView
. When I detect this I will then check the data and do my thing.
According to the documents, I found out about UIResponder
.
So I created an simple class that inherits UITextView
.
in the .m file I create 1 function called.
-(void) paste:(id)sender{
NSLog(@"paste button was pressed do something");
}
But for some reason it never seems to fire. I could get the select statement working and tracing data.
-(void) select:(id)sender
1. Is this the correct way to detect Paste in a UITextView? 2. Right now I am tracking buy how many Characters UITextView changes and if its greater than one char then I suspect that it could be a paste operation. But since the iPhone can autocomplete words eg Wedn (goes to Wednesday) its possibly not a paste operation.
In Interface Builder, I selected my textView in my NIB file, and selected its "Class Identity" to my nearly created class before and I know that this file was working as a subclass but it just would not respond to the Paste event.
thanks.