How can I implement the new iPad Pro keyboard shortcut feature?

The Apple iPad Pro page talks about the new keyboard shortcut feature:

Shortcuts at your fingertips.

iOS 9 works seamlessly with a smart keyboard, adding many useful QuickType features to your iPad Pro.

enter image description here

Time-saving shortcuts

Use keyboard shortcuts to perform even more commands on your iPad Pro - for example, switching between applications or searching using the smart keyboard. And interact with your applications using your own built-in custom shortcuts. Just press and hold a key, such as Command, Option or Control, to see shortcuts in any application.

I tried to find iOS 9 and iOS 9.1 API Pages and cannot find anything about keyboard shortcuts.

How can I implement this feature in my application or where can I find documentation that talks about this?

+7
ios ipad keyboard-shortcuts
source share
1 answer

It looks like most of this feature already existed with iOS 7 called UIKeyCommand .

The only thing that was added is a discoverabilityTitle , which is used to display the available command names on any iPad running iOS 9+, you can see this menu in the simulator by holding down the command key on any screen that contains keyboard shortcuts (for example, the home screen iOS).

enter image description here

There's a good NSHipster entry here that includes these iOS 9 features.

Essentially you need to do the following:

  • Allow the view manager to be the first responder.
  • Returns an array of UIKeyCommands in the keyCommands controller keyCommands .
  • Process the action sent to the view controller.
+8
source share

All Articles