CINXE.COM
Keyman for iPhone and iPad Developer Support
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Keyman for iPhone and iPad Developer Support</title> <script src="/cdn/deploy/js/sentry.bundle.5.28.0.min.94ac314aeac15a10211c943fbbb0b85b.js"></script> <script> Sentry.init({ dsn: "https://fcc8fe39792f49f3a94ea831cad5c9d6@o1005580.ingest.sentry.io/5983515", environment: location.host.match(/\.local$/) ? 'development' : location.host.match(/(^|\.)keyman-staging\.com$/) ? 'staging' : 'production', }); </script> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> <link rel='shortcut icon' href="/cdn/deploy/img/favicon.56e7a2d76793fb59cca3133b8bb1dd3d.ico"> <link rel='canonical' href='/developer/engine/iphone-and-ipad/current-version/'> <link rel="stylesheet" type="text/css" href="/cdn/deploy/css/template.5e9adfa8a8262134cd0ab5ba65411347.css"> <link rel="stylesheet" type="text/css" href="/cdn/deploy/css/prism.e774a7ee19b37e3501dd4ef14ca98b8a.css"> <link href='https://fonts.googleapis.com/css?family=Cabin:400,400italic,500,600,700,700italic|Source+Sans+Pro:400,700,900,600,300|Noto+Serif:400' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic' rel='stylesheet' type='text/css'> <script type='text/javascript' src='/cdn/deploy/js/keyrenderer.6c496dc07a927c012cd6167f1f246f1b.js'></script> <script type="text/javascript"> // Add a script element as a child of the body function downloadJS(src) { var element = document.createElement("script"); element.src = src; document.body.appendChild(element); } function downloadJSAtOnload() { downloadJS("/cdn/deploy/js/jquery1-11-1.min.8101d596b2b8fa35fe3a634ea342d7c3.js"); downloadJS("/cdn/deploy/js/kmlive.68c269576297f036e07a036223b0ebbd.js"); //downloadJS("/cdn/deploy/js/keyrenderer.6c496dc07a927c012cd6167f1f246f1b.js"); } // Check for browser support of event handling capability if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; </script> </head> <body data-device="Windows" data-section="developer"> <div id="phone-menu"> <div id="phone-menu-inner"> <div class="phone-menu-item"> <h3>Product Support</h3> <ul> <li><a href="/products/windows/">Keyman for Windows</a></li> <li><a href="/products/mac/">Keyman for macOS</a></li> <li><a href="/products/linux/">Keyman for Linux</a></li> <li><a href="/products/web/">Keymanweb.com</a></li> <li><a href="/products/iphone-and-ipad/">Keyman for iPhone and iPad</a></li> <li><a href="/products/android/">Keyman for Android</a></li> <li><a href="/products/bookmarklet/">Keyman Bookmarklet</a></li> <hr/> <li><a href="/knowledge-base/">Knowledge Base</a></li> </ul> </div> <div class="phone-menu-item"> <h3>Keyboard Support</h3> <ul> <li><a href="/keyboard">Keyboard Home</a></li> </ul> </div> <div class="phone-menu-item"> <h3>Developer Support</h3> <ul> <li><a href="/developer">Developer Home</a></li> <li><a href="/developer/current-version/">Keyman Developer</a></li> <li><a href="/developer/engine/web/">Keyman Engine for Web</a></li> <li><a href="/developer/engine/iphone-and-ipad/">Keyman Engine for iPhone and iPad</a></li> <li><a href="/developer/engine/android/">Keyman Engine for Android</a></li> <li><a href="/developer/engine/desktop/">Keyman Engine for Desktop</a></li> <li><a href="/developer/cloud/">Keyman Cloud</a></li> </ul> </div> <div class="phone-menu-item"> <h3>Contact and Search</h3> <ul> <li><a href="https://keyman.com/contact">Contact Us</a></li> <li><a href="/search/">Search Help</a></li> </ul> </div> <div class="phone-menu-item"> <h3>Keyman.com Homepage</h3> <ul> <li><a href="https://keyman.com">Keyman.com</a></li> </ul> </div> </div> </div><div id="container"> <div class="header"> <img id="show-phone-menu" src="/cdn/deploy/img/phonehide.ca5b6569ec86dfcbdff8ca4008c96283.png" /> <a id="home-link" href="/"><img id="logo" src="/cdn/deploy/img/logo2.d8805a27a5c0399d234f1f84aca74cae.png" alt='Keyman Logo' /></a> <img id="header-bottom" src="/cdn/deploy/img/headerbar.5b66d10475396d1a17cb0d687f794262.png" alt='Header bottom' /> <a id="help" href="https://keyman.com"><p id="keyman-help">Keyman.com</p><img src="/cdn/deploy/img/helpIcon.e6531e8bf34d0f667dac699db8f7438f.png"></a> </div> <div id="top-menu-bg"></div> <div id="top-menu1"> <a href="/"><img id="top-menu-icon" src="/cdn/deploy/img/icon1.c7a2600d263e5bfc94580e153ddd38f0.png" /></a> <div class="menu-wrapper"> <div class="menu-item" id="keyboards"> <h3><a href="/products/">Product Support</a><span class="header-triangle"><img src="/cdn/deploy/img/img_trans.ccca81506160a8ccf8003ae57a97b115.png" /></span></h3> <div class="menu-item-dropdown"> <div class="menu-dropdown-inner"> <ul> <li><a href="/products/windows/">Keyman for Windows</a></li> <li><a href="/products/mac/">Keyman for macOS</a></li> <li><a href="/products/linux/">Keyman for Linux</a></li> <li><a href="/products/web/">Keymanweb.com</a></li> <li><a href="/products/iphone-and-ipad/">Keyman for iPhone and iPad</a></li> <li><a href="/products/android/">Keyman for Android</a></li> <li><a href="/products/bookmarklet/">Keyman Bookmarklet</a></li> <hr/> <li><a href="/knowledge-base/">Knowledge Base</a></li> </ul> </div> </div> </div> <div class="menu-item" id="products"> <a href="/keyboard/" ><h3>Keyboard Documentation</h3></a> </div> <div class="menu-item" id="developers"> <h3><a href="/developer/">Developer Home</a><span class="header-triangle"><img src="/cdn/deploy/img/img_trans.ccca81506160a8ccf8003ae57a97b115.png" /></span></h3> <div class="menu-item-dropdown"> <div class="menu-dropdown-inner"> <ul> <li><a href="/developer/current-version/">Keyman Developer</a></li> <li><a href="/developer/language/">Keyman Keyboard Language</a></li> <li><a href="/developer/engine/web/">Keyman Engine for Web</a></li> <li><a href="/developer/engine/iphone-and-ipad/">Keyman Engine for iOS</a></li> <li><a href="/developer/engine/android/">Keyman Engine for Android</a></li> <li><a href="/developer/engine/desktop/">Keyman Engine for Desktop</a></li> <li><a href="/developer/cloud/">Keyman Cloud</a></li> </ul> </div> </div> </div> <div class="menu-item" id="tavultesoft"> <a href="https://keyman.com/contact/" ><h3>Contact Us</h3></a> </div> <div class="menu-pseudo-item" id="menu-search"> <form action="/search/" method="get" role="search"> <div class="search-wrap"> <label for="main-q" class="offscreen">Search</label> <input type="search" id="main-q" name="q" placeholder="Search" data-value="" value="" /> <button type="submit" class="offscreen">Search</button> </div> </form> </div> </div> <img id="top-menu-bottom" src="/cdn/deploy/img/headerbar.5b66d10475396d1a17cb0d687f794262.png" /> </div> <div id="phone-header-spacer"></div><div id="breadcrumbTrail"><a href="/">help.keyman.com</a> > <a href="../../../../developer/">Developer </a> > <a href="../../../engine/">Engine </a> > <a href="../../iphone-and-ipad/">Iphone and ipad </a> > Current version </div><div id='version-selector'>Other versions<div><span>Version 18.0 (current version)</span><a href='/developer/engine/iphone-and-ipad/16.0/'>Version 16.0</a><a href='/developer/engine/iphone-and-ipad/15.0/'>Version 15.0</a><a href='/developer/engine/iphone-and-ipad/14.0/'>Version 14.0</a><a href='/developer/engine/iphone-and-ipad/13.0/'>Version 13.0</a><a href='/developer/engine/iphone-and-ipad/12.0/'>Version 12.0</a><a href='/developer/engine/iphone-and-ipad/11.0/'>Version 11.0</a><a href='/developer/engine/iphone-and-ipad/10.0/'>Version 10.0</a><a href='/developer/engine/iphone-and-ipad/2.0/'>Version 2.0</a></div></div><div class="main"> <div id="section2"> <div class="column-left show-index"> <div id="index"> <h3>Index</h3> <div id="index-content"><ul><li><a href='./'>Keyman for iPhone and iPad Developer Support</a><ul><li><a href='KeyboardPickerBarButtonItem' title='KeyboardPickerBarButtonItem class'>KeyboardPickerBarButtonItem class</a></li><li><a href='KeyboardPickerButton' title='KeyboardPickerButton class'>KeyboardPickerButton class</a></li><li><a href='guides' title='Keyman Engine for iPhone and iPad Developer Guides'>Keyman Engine for iPhone and iPad Developer Guides</a></li><li><a href='KeymanPackage' title='KeymanPackage class'>KeymanPackage class</a></li><li><a href='LanguageResource' title='LanguageResource protocol'>LanguageResource protocol</a></li><li><a href='Manager' title='Manager class'>Manager class</a></li><li><a href='PackageWebViewController' title='PackageWebViewController class'>PackageWebViewController class</a></li><li><a href='ResourceFileManager' title='ResourceFileManager class'>ResourceFileManager class</a></li><li><a href='TextField' title='TextField class'>TextField class</a></li><li><a href='TextView' title='TextView class'>TextView class</a></li><li><a href='TypedKeymanPackage' title='TypedKeymanPackage class'>TypedKeymanPackage class</a></li></ul></li></ul></div> </div> </div> <div class="column-right"> <div id="toc"> <h3>On this page</h3> <div id="toc-content"></div> </div> </div> <div class="wrapper"> <article><h1>Keyman for iPhone and iPad Developer Support</h1> <div class='markdown'><hr /> <h2>Overview</h2> <p>The Keyman Engine for iPhone and iPad 16.0 SDK is designed to provide advanced international keyboard support to iOS apps. </p> <p>As a developer, you simply need to use (or subclass) TextView or TextField instead of using an ordinary UITextView or UITextField. </p> <p>To let a user pick/download additional keyboards, there are 2 pre-made buttons you can use that bring up the Keyman keyboard UI. </p> <p>All of the methods and delegate calls of the original UIKit classes are retained. </p> <p>As of version 14.0, we deprecated direct use of .js files for resources in favor of supporting .kmp packages. Package files have the same old .js files bundled alongside any related resources (like fonts and documentation) on your behalf, making the process of setting up keyboards and lexical models easier.</p> <h2>Guides</h2> <ul> <li><a href="guides/in-app/">Build an in-app keyboard</a></li> <li><a href="guides/system-keyboard/">Build a system keyboard app</a></li> </ul> <h2>Available Classes/Methods</h2> <h3>Resource Identification</h3> <dl> <dt><a href="LanguageResource/LanguageResourceFullID"><code>LanguageResourceFullID</code></a></dt> <dd>The LanguageResourceFullID protocol and its implementing types <code>FullKeyboardID</code> and <code>LexicalModelFullID</code> serve as unique identifiers for language resources, whether installed or uninstalled.</dd> <dt><a href="LanguageResource"><code>LanguageResource</code></a></dt> <dd>The LanguageResource protocol and its implementing types <code>InstallableKeyboard</code> and <code>InstallableLexicalModel</code> represent the full metadata specification for a single installed pairing of keyboard or model & target language.</dd> <dt><a href="KeymanPackage/"><code>KeymanPackage</code></a></dt> <dd>The KeymanPackage is the base class used to represent various types of Keyman packages within the Keyman Engine and their contents. This class also serves a "type erasure" role for classes derived from it.</dd> <dt><a href="TypedKeymanPackage/"><code>TypedKeymanPackage</code></a></dt> <dd>The TypedKeymanPackage (and its direct subclasses <code>KeyboardKeymanPackage</code> and <code>LexicalModelKeymanPackage</code>) provide enhanced type signatures.</dd> </dl> <h3>Resource Management</h3> <dl> <dt><a href="ResourceFileManager/"><code>ResourceFileManager</code></a></dt> <dd>The core class for managing and installing keyboards and lexical models</dd> </dl> <h3>Controlling the Keyboard</h3> <dl> <dt><a href="Manager/"><code>Manager</code></a></dt> <dd>The core class for controlling Keyman Engine</dd> </dl> <h3>UI elements & setup</h3> <dl> <dt><a href="TextField/"><code>TextField</code></a></dt> <dd>A UITextField to use with the Keyman Engine</dd> <dt><a href="TextView/"><code>TextView</code></a></dt> <dd>A UITextView to use with the Keyman Engine</dd> <dt><a href="KeyboardPickerButton/"><code>KeyboardPickerButton</code></a></dt> <dd>A button for bringing up the keyboard picker menu</dd> <dt><a href="KeyboardPickerBarButtonItem/"><code>KeyboardPickerBarButtonItem</code></a></dt> <dd>A bar that displays the keyboard picker when tapped</dd> <dt><a href="PackageWebViewController/"><code>PackageWebViewController</code></a></dt> <dd>Displays web pages contained within packages, ejecting any links outside the package into an external browser.</dd> </dl> <h2>Adding the Keyman Engine for iPhone and iPad SDK to your project</h2> <p>1) Create a new iOS project</p> <p>2) On your project's "General" tab, click the '+' sign under "Embedded Binaries" to add KeymanEngine.framework.</p> <ul> <li>If you wish to use KeymanEngine-universal.framework instead for development, be aware that you may need to note the following: <ul> <li>Xcode may have issues with the "-universal" part of the name; dropping this component after copying may be prudent.</li> <li>The 16.0 version of Keyman Engine for iPhone and iPad was compiled using Swift 5.</li> <li>Dragging the framework into the project will not properly set the framework up for embedding.</li> </ul></li> <li>When done properly, Xcode should automatically link the library and setup the bundle for copying. <ul> <li>To verify, go to your target's "Build Phases" tab and check that the following details are in place: <ul> <li>'KeymanEngine.framework' is set within "Link Binary With Libraries"</li> <li>'KeymanEngine.framework' is set within "Embed Frameworks"</li> </ul></li> </ul></li> </ul> <p>3) Include KeymanEngine's dependencies within your project:<br /> (found in 'Link Binary With Libraries' in your target's 'build phases' tab)</p> <ul> <li>Ensure each of the following frameworks is included under "Embedded Binaries": <ul> <li>DeviceKit</li> <li>ObjcExceptionBridging</li> <li>Reachability</li> <li>Sentry</li> <li>XCGLogger</li> <li>Zip</li> </ul></li> <li>You may find it helpful to use a dependency manager (such as <a href="https://github.com/Carthage/Carthage">Carthage</a>) to assist with framework maintenance. You may find our Cartfile (used with Carthage) for this <a href="https://github.com/keymanapp/keyman/blob/master/ios/Cartfile">here</a>.</li> </ul> <p>4) Import "KeymanEngine" into any source files requiring Keyman classes.</p> <p>5) [OPTIONAL] Add the language .kmp files which you want to use to your project (e.g. thai_kedmanee.kmp)</p> <ul> <li>drag them into the project</li> <li>go to your target, then the "Build Phases" tab, and add them to the "Copy Bundle Resources" section</li> <li>to avoid xcode warnings, remove them from the "Compile Sources" section</li> </ul> <p>6) [OPTIONAL] Set the initial language prior to showing the keyboard for the first time</p> <ul> <li> <p>it is recommended to do this when the app first launches</p> </li> <li> <p>e.g. for Thai Kedmanee</p> <pre><code class="language-swift">Manager.shared.setKeyboard("thai_kedmanee");</code></pre> </li> <li> <p>the keyboard defaults to English USA if not set otherwise</p> </li> </ul> <h2>Keyman Demo</h2> <p>To see the SDK in action, open the samples folder to find two small sample projects. All of the above steps have already been performed.</p> <h2>See also</h2> <ul> <li><a href="/developer/engine/iphone-and-ipad/13.0/">Keyman Engine for iPhone and iPad 13.0</a></li> <li><a href="/developer/engine/iphone-and-ipad/12.0/">Keyman Engine for iPhone and iPad 12.0</a></li> <li><a href="/developer/engine/iphone-and-ipad/11.0/">Keyman Engine for iPhone and iPad 11.0</a></li> <li><a href="/developer/engine/iphone-and-ipad/10.0/">Keyman Engine for iPhone and iPad 10.0</a></li> <li><a href="/developer/engine/iphone-and-ipad/2.0/">Keyman Engine for iPhone and iPad 2.0</a></li> <li><a href="/developer/current-version/">Keyman Developer</a></li> <li><a href="http://keyman.com/developer/keymanweb/keyboards">Keyboard Library</a></li> <li><a href="/developer/engine/android/current-version/">Keyman Engine for Android 10.0</a></li> </ul></div> </article> </div> </div> </div> <div class="footer"> <div class="wrapper"> <div class="footer-third"> <h2 class="footer-third-title">Keep me updated</h2> <!-- Begin MailChimp Signup Form --> <div id="mc_embed_signup"> <form action="https://keyman.us1.list-manage.com/subscribe/post?u=99fcab2b035a8a51cd2158ca9&id=7ccdac1e32" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate> <div class="mc-field-group"> <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="email" /> </div> <div id="mce-responses" class="clear"> <div class="response" id="mce-error-response" style="display:none"></div> <div class="response" id="mce-success-response" style="display:none"></div> </div> <div class="button subscribe"> <h2>Subscribe</h2> </div> </form> </div> <!--End mc_embed_signup--> <br> <div id="privacy-policy"><a href="https://software.sil.org/language-software-privacy-policy">Privacy policy</a></div> </div> <div class="footer-third" id="footer-social"> <h2 class="footer-third-title">Keep in touch</h2> <div> <a href="https://facebook.com/KeymanApp" target="_blank" data-icon=''>Facebook</a> <a href="https://twitter.com/keyman" target="_blank" data-icon=''>Twitter</a> <a href="https://blog.keyman.com/" target="_blank" data-icon=''>Keyman blog</a> <a href="https://github.com/keymanapp" target="_blank" data-icon=''>GitHub</a> <a href="https://community.software.sil.org/c/keyman" target="_blank" id='footer-community'>Keyman Community</a> </div> </div> <div class="footer-third sil-logo"> <br> <a href="https://www.keyman.com/about/"><img id="sil-logo" src="/_common/assets/sil-logos-2024/sil-logo-annapurna.png" width="50%" alt='SIL' /></a> <p>Created by <a href="https://www.keyman.com/about/">SIL Global</a></p> </div> </div> </div> <div class="footer-tab-holder" id='footer-tab-support'> <div class="footer-tab"><h4><a href='https://community.software.sil.org/c/keyman'>Support</a></h4></div> </div> <div class="footer-tab-holder" id='footer-tab-edit'> <div class="footer-tab"><h4><a href='https://github.com/keymanapp/help.keyman.com/edit/master/developer/engine/iphone-and-ipad/16.0/index.md' target='_blank'>Edit page</a></h4></div> </div> <div id="KeymanWebControl"></div> <script src='/cdn/deploy/js/prism.d0f5cae6b89b314c659037fb44846584.js'></script> </body> </html>