mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-06 08:55:34 +00:00
49 lines
1.5 KiB
Swift
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()
|
|
}
|
|
}
|