Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

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

On this page

Manager.stateForLexicalModel()

Summary

The stateForLexicalModel() method returns the current state of availability for a dictionary.

Syntax

Manager.stateForLexicalModel(withID: String)

Parameters

withID
ID of the dictionary.

Returns

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

Description

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

Examples

Example: Using stateForLexicalModel()

The following script illustrates the use of stateForLexicalModel():

let dictState = Manager.shared.stateForLexicalModel(withID: dict.id)
if dictState == .needsUpdate {
  if !dictIDs.contains(dict.id) {
    dictIDs.insert(dict.id)
    updateQueue!.append(dict)
  }
}