Advertisement
ZTCYING

Lab1- Hello Android

May 4th, 2024
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 4.89 KB | None | 0 0
  1.  
  2. //
  3. //  SceneDelegate.swift
  4. //  HelloAndroid
  5. //
  6. //  Created by Sabin Tabirca on 19/01/2024.
  7. //
  8.  
  9. import UIKit
  10.  
  11. class SceneDelegate: UIResponder, UIWindowSceneDelegate {
  12.  
  13.     var window: UIWindow?
  14.  
  15.  
  16.     func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
  17.         // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
  18.         // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
  19.         // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
  20.         guard let _ = (scene as? UIWindowScene) else { return }
  21.     }
  22.  
  23.     func sceneDidDisconnect(_ scene: UIScene) {
  24.         // Called as the scene is being released by the system.
  25.         // This occurs shortly after the scene enters the background, or when its session is discarded.
  26.         // Release any resources associated with this scene that can be re-created the next time the scene connects.
  27.         // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
  28.     }
  29.  
  30.     func sceneDidBecomeActive(_ scene: UIScene) {
  31.         // Called when the scene has moved from an inactive state to an active state.
  32.         // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
  33.     }
  34.  
  35.     func sceneWillResignActive(_ scene: UIScene) {
  36.         // Called when the scene will move from an active state to an inactive state.
  37.         // This may occur due to temporary interruptions (ex. an incoming phone call).
  38.     }
  39.  
  40.     func sceneWillEnterForeground(_ scene: UIScene) {
  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.  
  45.     func sceneDidEnterBackground(_ scene: UIScene) {
  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.     }
  50.  
  51.  
  52. }
  53.  
  54. //
  55. //  SceneDelegate.swift
  56. //  HelloAndroid
  57. //
  58. //  Created by Sabin Tabirca on 19/01/2024.
  59. //
  60.  
  61. import UIKit
  62.  
  63. class SceneDelegate: UIResponder, UIWindowSceneDelegate {
  64.  
  65.     var window: UIWindow?
  66.  
  67.  
  68.     func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
  69.         // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
  70.         // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
  71.         // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
  72.         guard let _ = (scene as? UIWindowScene) else { return }
  73.     }
  74.  
  75.     func sceneDidDisconnect(_ scene: UIScene) {
  76.         // Called as the scene is being released by the system.
  77.         // This occurs shortly after the scene enters the background, or when its session is discarded.
  78.         // Release any resources associated with this scene that can be re-created the next time the scene connects.
  79.         // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
  80.     }
  81.  
  82.     func sceneDidBecomeActive(_ scene: UIScene) {
  83.         // Called when the scene has moved from an inactive state to an active state.
  84.         // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
  85.     }
  86.  
  87.     func sceneWillResignActive(_ scene: UIScene) {
  88.         // Called when the scene will move from an active state to an inactive state.
  89.         // This may occur due to temporary interruptions (ex. an incoming phone call).
  90.     }
  91.  
  92.     func sceneWillEnterForeground(_ scene: UIScene) {
  93.         // Called as the scene transitions from the background to the foreground.
  94.         // Use this method to undo the changes made on entering the background.
  95.     }
  96.  
  97.     func sceneDidEnterBackground(_ scene: UIScene) {
  98.         // Called as the scene transitions from the foreground to the background.
  99.         // Use this method to save data, release shared resources, and store enough scene-specific state information
  100.         // to restore the scene back to its current state.
  101.     }
  102.  
  103.  
  104. }
  105.  
  106. //
  107. //  ViewController.swift
  108. //  HelloAndroid
  109. //
  110. //  Created by Sabin Tabirca on 19/01/2024.
  111. //
  112.  
  113. import UIKit
  114.  
  115. class ViewController: UIViewController {
  116.  
  117.     override func viewDidLoad() {
  118.         super.viewDidLoad()
  119.         // Do any additional setup after loading the view.
  120.     }
  121.  
  122.  
  123. }
  124.  
  125.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement