Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 18.0 (current version)Version 16.0Version 15.0Version 14.0

On this page

.install()


Summary

The install() method is used to install resources from opened package files.

Syntax

ResourceFileManager.shared.install(resourceWithID: URL, from: KeymanPackage) throws

Parameters

resourceWithID
Either a FullKeyboardID or a FullLexicalModelID corresponding to the resource to be installed from the package.
from
The opened package file

Throws

May fail if the package does not contain or support the designated resource and language pairing specified by the resource's ID.

Description

This syntax can be used for installing resources from a KMP package.

Example: Using install() to install a keyboard

The following script illustrates the use of install():

let packageURL = Bundle.main.url(forResource: "sil_euro_latin", withExtension: "kmp")!
let keyboardID = FullKeyboardID("sil_euro_latin", "fr") // Marks the keyboard for use with French.
do {
  if let keyboardPackage = try ResourceFileManager.shared.prepareKMPInstall(packageURL) as? KeyboardKeymanPackage {
    try ResourceFileManager.shared.install(resourceWithID: keyboardID, from: keyboardPackage)
  } else {
    // Report the error
  }
} catch {
  // Report the error
}

History

  • Added in Keyman Engine for iPhone and iPad 14.0.

See also