Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
print("1 didFinishLaunchingWithOptions 開始lunching")
return true
}
func applicationWillResignActive(_ application: UIApplication) {
print("2 applicationWillResignActive 將結束活動")
}
func applicationDidEnterBackground(_ application: UIApplication) {
print("3 applicationDidEnterBackground 進入後台")
}
func applicationWillEnterForeground(_ application: UIApplication) {
print("4 applicationWillEnterForeground 進入前端")
}
func applicationDidBecomeActive(_ application: UIApplication) {
print("5 applicationDidBecomeActive 已經活動")
}
func applicationWillTerminate(_ application: UIApplication) {
print("6 applicationWillTerminate 掰掰")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment