Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

On this page

Manager.preloadFiles()

Summary

The preloadFiles() method preloads the JS and font files required for a keyboard

Syntax

Manager.preloadFiles(forKeyboardID: keyboardID, urls: [URL], shouldOverwrite: Bool)

Parameters

forKeyboardID
The full keyboard ID.
urls
Array of URLs to the files
shouldOverwrite
true to overwrite exisiting files, false otherwise.

Description

Use this method to tell Keyman where the required keyboard files are.

Examples

Example: Using preloadFiles()

The following script illustrates the use of preloadFiles():

let kb = InstallableKeyboard(id: "tamil99m",
     name: "Tamil 99M",
     languageID: "ta",
     languageName: "Tamil",
     version: "1.1",
     isRTL: false,
     font: Font(filename: "aava1.ttf"),
     oskFont: nil,
     isCustom: true)
let urls = [
  Bundle.main.url(forResource: "tamil99m-1.1", withExtension: "js")!,
  Bundle.main.url(forResource: "aava1", withExtension: "ttf")!
]
do {
  try Manager.shared.preloadFiles(forKeyboardID: kb.id, at: urls, shouldOverwrite: true)
} catch {
  print("Error preloading: \(error)")
}