set the preferred lexical model to the one the user selects

This commit is contained in:
Randy Boring 2019-07-25 02:21:29 -04:00
parent eaa7c89cbf
commit b6748c84af

View file

@ -289,7 +289,9 @@ class LexicalModelPickerViewController: UITableViewController, UIAlertViewDelega
private func switchLexicalModel(_ index: Int) {
// Switch lexicalModel and register to user defaults.
if Manager.shared.registerLexicalModel(userLexicalModels[index]) {
let lm = userLexicalModels[index]
if Manager.shared.registerLexicalModel(lm) {
Storage.active.userDefaults.set(preferredLexicalModelID: lm.id, forKey: lm.languageID)
tableView.reloadData()
}