Opt out of UISceneDelegate/SwiftUI on iOS
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
Whether you can "opt out" depends on which lifecycle you are actually using. In a UIKit app, you can remove scene-based lifecycle support and fall back to AppDelegate-only behavior by removing the scene manifest. In a SwiftUI app that uses the @main App lifecycle, scenes are part of the framework model, so you are not really opting out of scenes in the same way.
UIKit: How to Disable UISceneDelegate
For a UIKit app, scene support is enabled through UIApplicationSceneManifest in Info.plist and, typically, a SceneDelegate class.
If you want old-style single-app lifecycle behavior:
- remove the scene manifest from
Info.plist - remove
SceneDelegate.swift - move window setup back into
AppDelegate - remove scene-session lifecycle methods if they are no longer needed
Typical AppDelegate window setup:
That is the classic non-scene lifecycle.
This is mostly relevant for older UIKit-style apps or single-window apps that do not need scene support on modern iPadOS features.
SwiftUI: Scenes Are Built In
A SwiftUI app created with:
is already using SwiftUI's scene model. There is no separate UISceneDelegate file, but the app is still scene-based through WindowGroup and related scene types.
So if your question is "How do I use SwiftUI but avoid UISceneDelegate?" the answer is: SwiftUI already avoids the explicit delegate class, but it does not abandon the scene concept.
Mixing AppDelegate With SwiftUI
If you need traditional app-level hooks while still using SwiftUI views, attach an app delegate adapter:
This is usually the right approach if you want SwiftUI plus some UIApplicationDelegate behavior.
When You Truly Need the Old Lifecycle
If you need a fully non-scene app lifecycle, stay with a UIKit app entry point and remove the scene manifest. That is a UIKit choice, not a SwiftUI App lifecycle choice.
Trying to force a SwiftUI App into a non-scene model usually means fighting the framework instead of using it as designed.
If the real goal is just to regain one or two app-level hooks, @UIApplicationDelegateAdaptor is usually enough and is much less disruptive than rewriting the app entry point.
Common Pitfalls
The biggest mistake is thinking that removing SceneDelegate.swift from a SwiftUI app means scenes are gone. They are still there through WindowGroup.
Another mistake is deleting the scene manifest from a UIKit project without moving window setup back into AppDelegate, leaving the app with no visible root view controller.
A third issue is mixing SwiftUI lifecycle expectations with UIKit lifecycle code without being clear about which entry point owns the window.
Summary
- In UIKit, you can opt out of
UISceneDelegateby removing the scene manifest and usingAppDelegate-managed windows. - In SwiftUI's
Applifecycle, scenes are part of the model even without an explicitSceneDelegateclass. - Use
@UIApplicationDelegateAdaptorif you want SwiftUI plus app-delegate hooks. - If you truly need a non-scene lifecycle, use the classic UIKit app model.
- Be clear about which entry point owns the app window and lifecycle.
Related reading
- Optional array vs. empty array in Swift
- optional closure and check if it is nil
- Outlets cannot be connected to repeating content iOS
- Override back button to act like home button
- Override back button to act like home button
- Overriding a stored property in Swift
- Overriding method with selector ''touchesBeganwithEvent'' has incompatible type ''NSSet, UIEvent - ''
- Overriding methods in Swift extensions
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.