AppDelegate.swift 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import UIKit
  17. @UIApplicationMain
  18. class AppDelegate: UIResponder, UIApplicationDelegate {
  19. var window: UIWindow?
  20. func application(_ application: UIApplication,
  21. didFinishLaunchingWithOptions launchOptions: [UIApplication
  22. .LaunchOptionsKey: Any]?) -> Bool {
  23. // Override point for customization after application launch.
  24. return true
  25. }
  26. func applicationWillResignActive(_ application: UIApplication) {
  27. // Sent when the application is about to move from active to inactive state. This can occur for
  28. // certain types of temporary interruptions (such as an incoming phone call or SMS message) or
  29. // when the user quits the application and it begins the transition to the background state.
  30. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering
  31. // callbacks. Games should use this method to pause the game.
  32. }
  33. func applicationDidEnterBackground(_ application: UIApplication) {
  34. // Use this method to release shared resources, save user data, invalidate timers, and store
  35. // enough application state information to restore your application to its current state in case
  36. // it is terminated later.
  37. // If your application supports background execution, this method is called instead of
  38. // applicationWillTerminate: when the user quits.
  39. }
  40. func applicationWillEnterForeground(_ application: UIApplication) {
  41. // Called as part of the transition from the background to the active state; here you can undo
  42. // many of the changes made on entering the background.
  43. }
  44. func applicationDidBecomeActive(_ application: UIApplication) {
  45. // Restart any tasks that were paused (or not yet started) while the application was inactive.
  46. // If the application was previously in the background, optionally refresh the user interface.
  47. }
  48. func applicationWillTerminate(_ application: UIApplication) {
  49. // Called when the application is about to terminate. Save data if appropriate. See also
  50. // applicationDidEnterBackground:.
  51. }
  52. }