-2

I have my project which supports minimum ios version 12.4 and I'm using swift 5.2 in my project. To suuport Zoom SDK I need to remove sceneDelegate.swift file and SceneManifest from info.plist. Is it safe to remove sceneDelegate from existing project? In my thought AppDelegate will be responsible for the application lifecycle and setup. The SceneDelegate will be responsible for what is shown on the screen (Windows or Scenes) handle and manage the way your app is shown.So will there be any issues in UI Flow of my APP if I remove Scene Delegate?

If I remove sceneDelegate how will handle app Foreground and Background Events?

  • 2
    Strongly related: https://stackoverflow.com/questions/57467003/opt-out-of-uiscenedelegate-swiftui-on-ios – HangarRash Dec 01 '22 at 06:18
  • 1
    *"how will handle app Foreground and Background Events?"* - the same way they were handled before UISceneDelegate existed - with the UIApplicationDelegate. – HangarRash Dec 01 '22 at 06:19

1 Answers1

1

Yes it 100% safe to remove SceneDelegate from your iOS app. Please refer below steps to remove it from your app

  1. Remove SceneDelegate.swift file
  2. Remove Application Scene Manifest from Info.plist file
  3. Add var window: UIWindow? to AppDelegate.swift
  4. Replace @main with @UIApplicationMain
  5. Remove UISceneSession Lifecycle ( functions ) in AppDelegate

After deleting scene delegate you would not able to do following

In iOS 13 and later, users can create multiple copies of your app’s UI and toggle between them in the app switcher. On iPad, users can also display one copy of your app’s UI side by side with another copy. For each copy of your app’s UI, you use a scene object to manage the window, views, and view controllers that present the UI onscreen

https://developer.apple.com/documentation/uikit/app_and_environment/scenes/specifying_the_scenes_your_app_supports

To answer you question to regarding view life cycle please refer this - https://www.appypie.com/scene-delegate-app-delegate-xcode-11-ios-13#:~:text=On%20iOS%2013,at%20a%20time.

teja_D
  • 383
  • 3
  • 18