I created a custom UIMenuController
in a UIWebView
but it seems to get rid of the \"Speak Selection\" option in the UIMenuController
after
I've found some interesting things with this bug. Basically, when speak selection is enabled, after you make the first selection the UIMenuController
is emptied of menuItems
. The solution, though hacky, is simple.
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
NSString *selectorString = NSStringFromSelector(action);
BOOL isAccessibilitySelector = [selectorString isEqualToString:@"_accessibilitySpeak:"] || [selectorString isEqualToString:@"_accessibilityPauseSpeaking:"];
if (isAccessibilitySelector && [super canPerformAction:action withSender:sender]) {
//(re)add menuItems to UIMenuController
return YES;
}
return NO;
}
I should note that you must re-add the menuItems
after their canPerformAction...()
has been called.
I have submitted this as radar:12931434. Update: DUP'ed to 13060693.