Hiding the copy / paste / return panel in iOS 9 (shortcut bar)

I am testing my application on the beta version of iOS 9. Apple has added a new panel with copy / paste / return functions.

I know that I can disable it in the general settings of my device.

Can I detect it in the code using notifications? And can I say that my text fields and text elements are not displayed when they are edited?

If I turn off the predictive view, a panel will be displayed.

I did not find it in the beta version of xCode 7 4. If you know how to fix this problem, let me know :)

+6
source share
2 answers

I solved the problem. I found a way to hide this shortcut bar programmatically:

if ([textView respondsToSelector:@selector(inputAssistantItem)]) { UITextInputAssistantItem *inputAssistantItem = [textView inputAssistantItem]; inputAssistantItem.leadingBarButtonGroups = @[]; inputAssistantItem.trailingBarButtonGroups = @[]; } 

You can also determine the version of iOS if you need. It is important to know that the UITextInputAssistantItem class is a new class for iOS 9.

 if ([[[UIDevice currentDevice] systemVersion] intValue] > 8.99) { // Your super-code } 

I hope this will be useful information!

+10
source

try it

 - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { if (action == @selector(paste:)) return NO; return [super canPerformAction:action withSender:sender]; } 

Hope this helps.

+1
source

All Articles