You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.3 KiB

2 months ago
  1. //
  2. // SceneDelegate.m
  3. // HC
  4. //
  5. // Created by huilinLi on 2025/11/17.
  6. //
  7. #import "SceneDelegate.h"
  8. #import "AppDelegate.h"
  9. @interface SceneDelegate ()
  10. @end
  11. @implementation SceneDelegate
  12. - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
  13. // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
  14. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
  15. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
  16. }
  17. - (void)sceneDidDisconnect:(UIScene *)scene {
  18. // Called as the scene is being released by the system.
  19. // This occurs shortly after the scene enters the background, or when its session is discarded.
  20. // Release any resources associated with this scene that can be re-created the next time the scene connects.
  21. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
  22. }
  23. - (void)sceneDidBecomeActive:(UIScene *)scene {
  24. // Called when the scene has moved from an inactive state to an active state.
  25. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
  26. }
  27. - (void)sceneWillResignActive:(UIScene *)scene {
  28. // Called when the scene will move from an active state to an inactive state.
  29. // This may occur due to temporary interruptions (ex. an incoming phone call).
  30. }
  31. - (void)sceneWillEnterForeground:(UIScene *)scene {
  32. // Called as the scene transitions from the background to the foreground.
  33. // Use this method to undo the changes made on entering the background.
  34. }
  35. - (void)sceneDidEnterBackground:(UIScene *)scene {
  36. // Called as the scene transitions from the foreground to the background.
  37. // Use this method to save data, release shared resources, and store enough scene-specific state information
  38. // to restore the scene back to its current state.
  39. // Save changes in the application's managed object context when the application transitions to the background.
  40. [(AppDelegate *)UIApplication.sharedApplication.delegate saveContext];
  41. }
  42. @end