Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 16.0 (current version)Version 15.0Version 14.0Version 13.0Version 12.0Version 11.0Version 10.0Version 2.0

On this page

Keyman for iPhone and iPad Developer Support

Overview

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

As a developer, you simply need to use (or subclass) TextView or TextField 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.

Guides

Available Classes/Methods

Everything you need should be in these classes. It is especially important to look at Manager.swift

Manager
The core class for controlling Keyman Engine
TextField
A UITextField to use with the Keyman Engine
TextView
A UITextView to use with the Keyman Engine
KeyboardPickerButton
A button for bringing up the keyboard picker menu
KeyboardPickerBarButtonItem
A bar that displays the keyboard picker when tapped

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
    Manager.shared.setKeyboard("thai_kedmanee");
    
  • 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:

  • TextView
  • TextField
  • KeyboardPickerButton
  • KeyboardPickerBarButtonItem
  • language fetching
  • keyboard downloading/switching
  • responding to Keyman events

See also