0

I just developed an iOS 8 Custom Keyboard and my users are requesting to be able to import the Keyboard Shortcuts in System Settings.

Settings -> General -> Keyboard -> Shortcuts

I thought it was impossible because all apps run in sandbox and does not have access to System Settings. However, this custom keyboard did achieve this.

https://itunes.apple.com/cn/app/bai-du-shu-ru-fa-zui-kuai/id916139408?mt=8

It has an option to import Keyboard Shortcuts next time when custom keyboard loads.

Anyone has any idea which API is this? Thanks.

memmons
  • 40,222
  • 21
  • 149
  • 183
Evan Chu
  • 2,190
  • 2
  • 20
  • 23

1 Answers1

0

From Apple's App Extension Programming Guide:

Every custom keyboard (independent of the value of its RequestsOpenAccess key) has access to a basic autocorrection lexicon through the UILexicon class. Make use of this class, along with a lexicon of your own design, to provide suggestions and autocorrections as users are entering text. The UILexicon object contains words from various sources, including:

  • Unpaired first names and last names from the user’s Address Book database
  • Text shortcuts defined in the Settings > General > Keyboard > Shortcuts list
  • A common words dictionary

In particular pay attention to UILexicon's requestSupplementaryLexiconWithCompletion:

Call this method to obtain a UILexicon object containing a basic set of term pairs for use in autocorrection or textual suggestions based on user input. The UILexicon object contains words from various sources, including:

  • Unpaired first names and last names from the user’s Address Book database
  • Text shortcuts defined in the Settings > General > Keyboard > Shortcuts list
  • A common words dictionary
memmons
  • 40,222
  • 21
  • 149
  • 183
  • I am aware of this API, but one thing will be how to differ from those different sources, but I will give it a try. – Evan Chu Nov 13 '14 at 07:23