SceneDelegate.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using Foundation;
  3. using UIKit;
  4. namespace NewSingleViewTemplate
  5. {
  6. [Register("SceneDelegate")]
  7. public class SceneDelegate : UIResponder, IUIWindowSceneDelegate
  8. {
  9. [Export("window")]
  10. public UIWindow Window { get; set; }
  11. [Export("scene:willConnectToSession:options:")]
  12. public void WillConnect(UIScene scene, UISceneSession session, UISceneConnectionOptions connectionOptions)
  13. {
  14. // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
  15. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
  16. // This delegate does not imply the connecting scene or session are new (see UIApplicationDelegate `GetConfiguration` instead).
  17. }
  18. [Export("sceneDidDisconnect:")]
  19. public void DidDisconnect(UIScene scene)
  20. {
  21. // Called as the scene is being released by the system.
  22. // This occurs shortly after the scene enters the background, or when its session is discarded.
  23. // Release any resources associated with this scene that can be re-created the next time the scene connects.
  24. // The scene may re-connect later, as its session was not neccessarily discarded (see UIApplicationDelegate `DidDiscardSceneSessions` instead).
  25. }
  26. [Export("sceneDidBecomeActive:")]
  27. public void DidBecomeActive(UIScene scene)
  28. {
  29. // Called when the scene has moved from an inactive state to an active state.
  30. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
  31. }
  32. [Export("sceneWillResignActive:")]
  33. public void WillResignActive(UIScene scene)
  34. {
  35. // Called when the scene will move from an active state to an inactive state.
  36. // This may occur due to temporary interruptions (ex. an incoming phone call).
  37. }
  38. [Export("sceneWillEnterForeground:")]
  39. public void WillEnterForeground(UIScene scene)
  40. {
  41. // Called as the scene transitions from the background to the foreground.
  42. // Use this method to undo the changes made on entering the background.
  43. }
  44. [Export("sceneDidEnterBackground:")]
  45. public void DidEnterBackground(UIScene scene)
  46. {
  47. // Called as the scene transitions from the foreground to the background.
  48. // Use this method to save data, release shared resources, and store enough scene-specific state information
  49. // to restore the scene back to its current state.
  50. }
  51. }
  52. }