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.

73 lines
2.6 KiB

2 months ago
2 months ago
1 month ago
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. #import "ViewController.h"
  10. #import "ChartViewController.h"
  11. @interface SceneDelegate ()
  12. @end
  13. @implementation SceneDelegate
  14. - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
  15. UIWindowScene *windowScene = (UIWindowScene *)scene;
  16. if (!windowScene) return;
  17. self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
  18. self.window.frame = windowScene.screen.bounds;
  19. self.window.backgroundColor = [UIColor blackColor];
  20. ViewController *loginVC = [[ViewController alloc] init];
  21. UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:loginVC];
  22. self.window.rootViewController = navVC;
  23. // ChartViewController *chartVC = [[ChartViewController alloc] init];
  24. // self.window.rootViewController = chartVC;
  25. [self.window makeKeyAndVisible];
  26. }
  27. - (void)sceneDidDisconnect:(UIScene *)scene {
  28. // Called as the scene is being released by the system.
  29. // This occurs shortly after the scene enters the background, or when its session is discarded.
  30. // Release any resources associated with this scene that can be re-created the next time the scene connects.
  31. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
  32. }
  33. - (void)sceneDidBecomeActive:(UIScene *)scene {
  34. // Called when the scene has moved from an inactive state to an active state.
  35. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
  36. }
  37. - (void)sceneWillResignActive:(UIScene *)scene {
  38. // Called when the scene will move from an active state to an inactive state.
  39. // This may occur due to temporary interruptions (ex. an incoming phone call).
  40. }
  41. - (void)sceneWillEnterForeground:(UIScene *)scene {
  42. // Called as the scene transitions from the background to the foreground.
  43. // Use this method to undo the changes made on entering the background.
  44. }
  45. - (void)sceneDidEnterBackground:(UIScene *)scene {
  46. // Called as the scene transitions from the foreground to the background.
  47. // Use this method to save data, release shared resources, and store enough scene-specific state information
  48. // to restore the scene back to its current state.
  49. // Save changes in the application's managed object context when the application transitions to the background.
  50. [(AppDelegate *)UIApplication.sharedApplication.delegate saveContext];
  51. }
  52. @end