Adopt UIScene lifecycle to fix demo app launch crash on iOS 27 - #152
Conversation
Apps built with the iOS 27 SDK must adopt the UIScene lifecycle; OTPKitDemo crashed at launch with EXC_BREAKPOINT in __UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption because it created its window in the app delegate with no scene delegate. - Add SceneDelegate owning the window and root view controller selection (onboarding vs. main), using UIWindow(windowScene:) - Slim AppDelegate to a bare UIApplicationDelegate - Declare a static UIApplicationSceneManifest in OTPKitDemo-Info.plist and drop the INFOPLIST_KEY_UIApplicationSceneManifest_Generation build settings so the manifest has a single source of truth
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
EXC_BREAKPOINTin__UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoptionbecause it created itsUIWindowin the app delegate with no scene delegate.SceneDelegatethat owns the window and root view controller selection (onboarding vs. main trip planner), usingUIWindow(windowScene:);AppDelegateis slimmed to a bareUIApplicationDelegate.UIApplicationSceneManifestinOTPKitDemo-Info.plistand removes theINFOPLIST_KEY_UIApplicationSceneManifest_Generationbuild settings so the manifest has a single source of truth (the generated one had no delegate class and would conflict with the hand-authored key).Test plan
EXC_BREAKPOINTin__UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoptionat launch.showMainViewControllerpath); location-permission prompt handled; map renders.hasCompletedOnboardingrestore branch inSceneDelegate); no new crash reports across any run.xcodebuild test -scheme OTPKitpasses (iPhone 17 Pro Max, iOS 26.3.1).Review notes (non-blocking, pre-existing)
hasCompletedOnboarding/otpServerURL/selectedRegionkeys + JSON-codedOTPRegionInfo) is still spelled out independently by the writer (OnboardingViewController) and the reader (nowSceneDelegate). Consolidating it into a small shared store (and possibly dropping the derivablehasCompletedOnboardingflag) would be a good follow-up; left out here to keep the migration diff minimal.mainindependent of this change: it referencesOTPKitDemoTests/TestPlan.xctestplan, which no longer exists (the demo test target was removed in an earlier reorganization).printstatements in the launch path (including one that already claimed to be "SceneDelegate") were dropped rather than carried over.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.