Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

On this page

Keyman for iPhone and iPad Developer Support

Keyman Engine for iPhone and iPad Developer Support

The Keyman Engine for iPhone and iPad SDK is designed to provide advanced international keyboard support to iOS apps.

As a developer, you simply need to use (or subclass) KMTextView or KMTextField instead of using an ordinary UITextView or UITextField.

To let a user pick/download additional keyboards, there are 2 pre-made buttons you can use that bring up the Keyman keyboard UI.

All of the methods and delegate calls of the original UIKit classes are retained.

Available Classes/Methods

Everything you need should be in these five classes:

  • KMManager
  • KMTextView
  • KMTextField
  • KMKeyboardPickerButton
  • KMKeyboardPickerBarButtonItem
Their header files are included with the library and have further documentation. It is especially important to look at KMManager.h

Adding the Keyman Engine for iPhone and iPad SDK to your project

1) create a new iOS project

2) drag the 'libKeyman' folder into your project

  • this includes the library itself, some headers and a resources bundle
  • Xcode should automatically link the library and setup the bundle for copying
    • if not, go to your target's "Build Phases" tab and add:
      • 'libKeyman.a' to "Link Binary With Libraries"
      • 'Keyman.bundle' to "Copy Bundle Resources"


3) add '-all_load' to 'other linker flags' in your project or target build settings
  • otherwise categories in the static library will fail and your app will crash at runtime


4) add the following frameworks/libraries to your project:
(found in 'Link Binary With Libraries' in your target's 'build phases' tab)
  • CFNetwork
  • MobileCoreServices
  • Libz
  • SystemConfiguration
  • CoreGraphics
  • UIKit
  • CoreText
  • AudioToolbox


5) import "Keyman.h" into any source files which require any Keyman classes

6) [OPTIONAL] add the language .js files which you want to use to your project (e.g. thai_kedmanee.js)
  • drag them into the project
  • go to your target, then the "Build Phases" tab, and add them to the "Copy Bundle Resources" section
  • to avoid xcode warnings, remove them from the "Compile Sources" section


7) [OPTIONAL] set the initial language prior to showing the keyboard for the first time
  • it is recommended to do this when the app first launches
  • e.g. for Thai Kedmanee -> [[KMManager sharedInstance] setKeyboardWithID:@"thai_kedmanee" languageID:@"tha"];
  • the keyboard defaults to English USA if not set otherwise

Keyman Demo

To see the SDK in action, open the KeymanDemo project. All of the above steps have already been performed.

Additionally, you can see examples of:

  • KMTextView
  • KMTextField
  • KMKeyboardPickerButton
  • KMKeyboardPickerBarButtonItem
  • language fetching
  • keyboard downloading/switching
  • responding to Keyman events

Feedback

If you have any feedback or questions, just fill in this form to get in touch.