ios – 如何实现新的iPad Pro键盘快捷键功能?

前端之家收集整理的这篇文章主要介绍了ios – 如何实现新的iPad Pro键盘快捷键功能?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Apple’s iPad Pro page谈到了一个新的键盘快捷键功能

Shortcuts at your fingertips.

iOS 9 works seamlessly with the Smart Keyboard,adding a variety of useful QuickType features to your iPad Pro.

07001

Time-saving Shortcuts

Use keyboard shortcuts to perform even more commands on your iPad Pro—like switching between apps or bringing up search with your Smart Keyboard. And interact with your apps using their own built-in custom shortcuts. Just press and hold a key like Command,Option,or Control to see shortcuts in anyapp.

我尝试搜索iOS 9iOS 9.1 API页面,但找不到任何有关键盘快捷键的信息.

如何在我的应用程序中实现此功能,或者在哪里可以找到谈论它的文档?

解决方法

看起来这个功能的大部分已经存在于iOS 7中,称为 UIKeyCommand.

唯一添加的是discoverabilityTitle,它用于在任何运行iOS 9的iPad上显示可用的命令名称.您可以在任何提供键盘快捷键的屏幕(例如iOS主屏幕)上按住命令键,在模拟器中看到此菜单.

有关于此的nice write up on NSHipster,其中包括这些iOS 9功能.

基本上你需要做以下事情:

>允许视图控制器成为第一响应者.>在视图控制器的keyCommands方法中返回一组UIKeyCommands.>处理发送到视图控制器的操作.

原文链接:https://www.f2er.com/iOS/333963.html

猜你在找的iOS相关文章