My ViewController implements the UITextView delegate method textViewDidChangeSelection . Everything works as expected when testing. However, if the application is placed in the background and then becomes active again, the delegate method is not called when the selection is changed in the TextView . Anyone else who has had this problem?
My subclass of UITextView does this:
self.inputView = [[UIView alloc] initWithFrame:CGRectZero];
The above information is designed to prevent the keyboard from being displayed, but support for TextView is supported.
The subclass also performs the following actions:
-(BOOL)canPerformAction:(SEL)action withSender:(id)sender{ { if ( [UIMenuController sharedMenuController] ) { [UIMenuController sharedMenuController].menuVisible = NO; } return NO; }
This means that when you click the UITextView button, a pop-up copy does not appear. I think this method looks a little strange, but I found it on SO some time ago, and it did what it should.
empee source share