I have a view that supports copying and shows an edit menu using the following code:
if ([self becomeFirstResponder]) { // bring up edit menu. UIMenuController *theMenu = [UIMenuController sharedMenuController]; [theMenu setTargetRect:[self _textRect] inView:self]; [theMenu setMenuVisible:YES animated:YES]; }
The problem is that when calling getFirstResponder, the keyboard is hidden. A good example of proper behavior is the SMS application. Double-tap the message until the response field is visible and the response field loses focus, but the keyboard remains in place. In addition, when the bubble cancels, the response window restores focus.
ios iphone ipad first-responder
David beck
source share