Skip to content

ios: attach to a scene that connected before didFinishLaunching - #713

Open
nivaldomcj wants to merge 1 commit into
not-fl3:masterfrom
nivaldomcj:ios-scene-already-connected
Open

nivaldomcj wants to merge 1 commit into
not-fl3:masterfrom
nivaldomcj:ios-scene-already-connected

Conversation

@nivaldomcj

Copy link
Copy Markdown

Follow-up to #634.

#634 moved window creation into a UISceneWillConnectNotification observer that application:didFinishLaunchingWithOptions: registers. When Info.plist has no UIApplicationSceneManifest, UIKit connects the scene before that method runs, so the notification is already gone, no window is created, and the app shows a black screen. The Info.plist in the README has no manifest, so following the README hits this. #634 isn't in a release yet; 0.4.11 predates it.

The window setup now lives in attach_to_scene, which the observer calls, and which didFinishLaunching also calls when connectedScenes already has a scene. The pending view is taken once, so whichever path runs first attaches it.

The README's Info.plist now declares the scene manifest, since apps built with the iOS 27 SDK don't launch without one. #634 says the manifest needs a UISceneDelegateClassName. In my tests it works without one, while naming a class that doesn't conform to UISceneDelegate makes UIKit throw at launch.

examples/quad on the simulators, built with Xcode 27.2:

iOS 26.5, no manifest iOS 26.5, manifest iOS 27.2, manifest
master black screen, no frames draws draws
this branch draws draws draws

Without the manifest, iOS 27.2 refuses to launch both builds with "UIScene life cycle is required for apps built with this SDK", which is what the README note is about.

cargo build --all-targets passes for aarch64-apple-darwin and x86_64-apple-darwin, and cargo check --all-targets for the iOS and tvOS targets.

Tested on macOS 27.2.1 (26B131), Apple M3 Max (arm64), Rust 1.98.0.

Without UIApplicationSceneManifest in Info.plist, UIKit connects the
scene before application:didFinishLaunchingWithOptions: runs, so the
UISceneWillConnectNotification observer registered there never fires,
no window is created and nothing is drawn. After registering the
observers, attach to an already-connected scene if there is one.

The README's Info.plist now declares the scene manifest, which apps
built with the iOS 27 SDK need to launch at all. No scene delegate class
is needed since miniquad creates the window itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant