spiegel-keyman/ios/engine/KMEI/KeymanEngineDemo/AppDelegate.swift
2017-12-07 14:37:24 +07:00

49 lines
1.5 KiB
Swift

//
// AppDelegate.swift
// KeymanEngineDemo
//
// Created by Gabriel Wong on 2017-10-05.
// Copyright © 2017 SIL International. All rights reserved.
//
import KeymanEngine
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool {
KeymanEngine.log.outputLevel = .debug
KeymanEngine.log.logAppDetails()
Manager.applicationGroupIdentifier = "group.KMEI"
Manager.shared.canRemoveDefaultKeyboard = true
Manager.shared.openURL = UIApplication.shared.openURL
window = UIWindow(frame: UIScreen.main.bounds)
let mainViewController = MainViewController(nibName: nil, bundle: nil)
let navCon = UINavigationController(rootViewController: mainViewController)
window!.rootViewController = navCon
window!.makeKeyAndVisible()
return true
}
func application(_ application: UIApplication, handleOpen url: URL) -> Bool {
return true
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return true
}
func applicationDidEnterBackground(_ application: UIApplication) {
FontManager.shared.unregisterCustomFonts()
}
func applicationWillEnterForeground(_ application: UIApplication) {
FontManager.shared.registerCustomFonts()
}
}