On iOS 27 beta 3, scene(_:willConnectTo:options:) is now called twice at launch — once for a .windowApplication scene, and once for a keyboard input scene (_UISceneSessionRoleKeyboardInputScene). On earlier iOS versions only the .windowApplication scene was delivered.
Parts of my code read connectedScenes and take the first element, e.g.:
UIApplication.shared.connectedScenes.first?.delegate as! SceneDelegate
In my testing the .windowApplication scene is always first, so .first still works — but I can't find any documentation confirming this ordering.
Questions:
-
Is the order of connectedScenes guaranteed (is .windowApplication always first), or should it be treated as unordered?
-
Should I instead always filter explicitly, e.g. first { $0 is UIWindowScene && $0.session.role == .windowApplication }?
-
Is delivering the keyboard-input scene to the app's UIWindowSceneDelegate intended on iOS 27, or a beta artifact?
FB24389661 (Ordering of UIApplication.connectedScenes not documented when multiple scene roles connect (iOS 27)