Migration from UIKit app lifecycle to SwiftUI app lifecycle fails
Originator: | florentmorin | ||
Number: | rdar://FB9692750 | Date Originated: | |
Status: | Open | Resolved: | |
Product: | SwiftUI Framework | Product Version: | |
Classification: | Reproducible: |
I currently have an app on the App Store, built with UIKit. App was rewritten to SwiftUI during this summer. Everything is OK with fresh install. But, when app is launched after an update, I can only saw a black screen. The only way to solve this is set a blank UISceneDelegateClassName in Info.plist file. But this solution create a warning when launching the app. 1. Create a UIKit app 2. Launch the app on simulator 3. Replace UIKit lifecycle by SwiftUI lifecycle (and remove unnecessary entries of Info.plist) 4. Launch the app Expected result: the app Current result: a black screen For easier debugging (especially to migrate between apps), a complete source code with 3 branches is attached: - main: UIKit sample app - swiftui: SwiftUI sample app - swiftui-fix-scenedelegate: SwiftUI app with a fix for Scene Delegate (with warning at launch) https://github.com/florentmorin/SwiftUIUpdate
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Try to add multiple scenes support in your info.plist
<key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> </dict>