Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

On this page

Manager.stateForKeyboard()

Summary

The stateForKeyboard() method returns the current state of availability for a keyboard.

Syntax

Manager.stateForKeyboard(keyboardID: String)

Parameters

keyboardID
ID of the keyboard.

Returns

Returns the keyboard state: downloading, needsDownload, needsUpdate, or upToDate.

Description

This syntax can be used for getting the state of a keyboard.

Examples

Example: Using stateForKeyboard()

The following script illustrates the use of stateForKeyboard():

let kbState = Manager.shared.stateForKeyboard(withID: kb.id)
if kbState == .needsUpdate {
  if !kbIDs.contains(kb.id) {
    kbIDs.insert(kb.id)
    updateQueue!.append(kb)
  }
}