Slide 18
Slide 18 text
"QQ%FMFHBUFͷྫ
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
lazy var appEventHandler = AppEventHandler()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
if #available(iOS 13.0, *) {} else {
window = appEventHandler.createWindow()
window?.makeKeyAndVisible()
}
return true
}
func applicationWillTerminate(_ application: UIApplication) {}
func applicationWillEnterForeground(_ application: UIApplication) {
if #available(iOS 13.0, *) {} else {
appEventHandler.willEnterForeground()
}
}
func applicationDidBecomeActive(_ application: UIApplication) {
if #available(iOS 13.0, *) {} else {
appEventHandler.didBecomeActive()
}
}
func applicationWillResignActive(_ application: UIApplication) {
if #available(iOS 13.0, *) {} else {
appEventHandler.willResignActive()
}
}
func applicationDidEnterBackground(_ application: UIApplication) {
if #available(iOS 13.0, *) {} else {
appEventHandler.didEnterBackground()
}
}
// MARK: UISceneSession Lifecycle
@available(iOS 13.0, *)
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
@available(iOS 13.0, *)
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {}
}