car in 場站查車鎖車 ios
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

78 líneas
3.2KB

  1. #import "SceneDelegate.h"
  2. @interface SceneDelegate ()
  3. @property NSUserDefaults* defaults;
  4. @end
  5. @implementation SceneDelegate
  6. - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
  7. // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
  8. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
  9. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
  10. }
  11. - (void)sceneDidDisconnect:(UIScene *)scene {
  12. // Called as the scene is being released by the system.
  13. // This occurs shortly after the scene enters the background, or when its session is discarded.
  14. // Release any resources associated with this scene that can be re-created the next time the scene connects.
  15. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
  16. }
  17. - (void)sceneDidBecomeActive:(UIScene *)scene {
  18. // Called when the scene has moved from an inactive state to an active state.
  19. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
  20. self.defaults = [NSUserDefaults standardUserDefaults];
  21. if ([self.defaults boolForKey:@"notFirstRun"]) {
  22. [self.window.rootViewController dismissViewControllerAnimated:YES completion:NULL];
  23. }
  24. }
  25. - (void)sceneWillResignActive:(UIScene *)scene {
  26. // Called when the scene will move from an active state to an inactive state.
  27. // This may occur due to temporary interruptions (ex. an incoming phone call).
  28. self.defaults = [NSUserDefaults standardUserDefaults];
  29. if ([self.defaults boolForKey:@"notFirstRun"]) {
  30. UIViewController *blankViewController = [UIViewController new];
  31. blankViewController.view.backgroundColor = [UIColor blackColor];
  32. [self.window.rootViewController presentViewController:blankViewController animated:YES completion:NULL];
  33. }
  34. }
  35. - (void)sceneWillEnterForeground:(UIScene *)scene {
  36. // Called as the scene transitions from the background to the foreground.
  37. // Use this method to undo the changes made on entering the background.
  38. self.defaults = [NSUserDefaults standardUserDefaults];
  39. if ([self.defaults boolForKey:@"notFirstRun"]) {
  40. [self.window.rootViewController dismissViewControllerAnimated:YES completion:NULL];
  41. }
  42. }
  43. - (void)sceneDidEnterBackground:(UIScene *)scene {
  44. // Called as the scene transitions from the foreground to the background.
  45. // Use this method to save data, release shared resources, and store enough scene-specific state information
  46. // to restore the scene back to its current state.
  47. self.defaults = [NSUserDefaults standardUserDefaults];
  48. if ([self.defaults boolForKey:@"notFirstRun"]) {
  49. UIViewController *blankViewController = [UIViewController new];
  50. blankViewController.view.backgroundColor = [UIColor blackColor];
  51. [self.window.rootViewController presentViewController:blankViewController animated:YES completion:NULL];
  52. }
  53. }
  54. @end