I've got a UIViewController
with UITextView
in its view. When user selects text, there's Define system menu item that uses UIReferenceLibraryViewController
to define the word. The problem is that the word stays selected after the dictionary is dismissed. I'd prefer it to be deselected (like it's done in iBooks).
I've tried to deselect the word using UIMenuControllerDidHideMenuNotification
:
[[NSNotificationCenter defaultCenter] addObserverForName:UIMenuControllerDidHideMenuNotification object:nil queue:nil usingBlock:^(NSNotification *notification) {
[textView setSelectedRange:NSMakeRange(0, 0)];
}];
This deselects the word but also freezes my UIViewController
with the following message:
2012-12-20 19:18:45.553 Pilcrow[7018:c07] Warning: Attempt to dismiss from view controller <_UIFallbackPresentationViewController: 0x75b8300> while a presentation or dismiss is in progress!
2012-12-20 19:18:45.963 Pilcrow[7018:c07] Unbalanced calls to begin/end appearance transitions for <_UIFallbackPresentationViewController: 0x75b8300>.
Any ideas?