How can I override the extended keyboard in the iOS 9 virtual keyboard?

The virtual keyboard in iOS 9 includes undo, redo, and paste elements. I notice that in my application they are always the same, but in Safari and others, they have different settings. I have a custom toolbar already like inputAccessoryView

and I would prefer it there other than iOS controls. I've looked around but I can't see anything that allows it to be overridden from my point of view. Is there a way to do this?

+3


source to share


1 answer


In Luke's comment on the original post, he described UITextInputAssistantItem as a private API. It's true this class hasn't appeared in the iOS 9 SDK documentation yet, but it does appear in the iOS 9 release notes and was introduced at WWDC ( session 107 , search for "helper"), so it seems to be good to use and discuss.

Here's a sample code example provided by an Apple employee on their public forum:



NSArray barButtonItems = @[ /* Create UIBarButtonItems and place them here */ ];  
UIBarButtonItem representativeItem = // This is optional, if present when there isn't enough room on the bar, the group will be replaced with this item  
UIBarButtonItemGroup *group = [[UIBarButtonItemGroup alloc] initWithBarButtonItems:barButtonItems representativeItem:representativeItem]  
textView.inputAssistantItem.leadingBarButtonGroups = @[ group ]; // replace the items on the bar. Alternatively you can append this group and get the default leading items with this extra group  

      

+1


source







All Articles