Skip to content

Commit 1bdc4ef

Browse files
MartinZikmundclaude
andcommitted
feat(templates): adopt the UIKit scene lifecycle in the iOS head
Apple is retiring the window-based UIApplicationDelegate life cycle. An app whose Info.plist has no UIApplicationSceneManifest already logs "UIScene lifecycle will soon be required" on iOS 26, and per Apple DTS "failing to adopt the scene-based life cycle in the next major iOS release will prevent the app from launching". This is therefore not an optional multi-window feature - a generated iOS head without it stops launching. Two halves that only work as a pair: - Info.plist gains a UIApplicationSceneManifest declaring UIApplicationSupportsMultipleScenes and one default scene configuration naming SceneDelegate as UISceneDelegateClassName. - Platforms/iOS/SceneDelegate.iOS.cs registers a [Register("SceneDelegate")] subclass of Uno.UI.Runtime.Skia.AppleUIKit.UnoUISceneDelegate. The registered name and UISceneDelegateClassName must match for UIKit to resolve the delegate at launch. Both are unconditional for the iOS head. Platforms/iOS/**/* is already excluded when iOS is not selected, so no further gating is needed. Multi-window on iPadOS falls out of scene adoption, but is a consequence rather than the reason: UIApplicationSupportsMultipleScenes could be set false later without giving up the lifecycle compliance. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01M4hG8PDawQsDBqY62tf2wG
1 parent 1438da7 commit 1bdc4ef

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎src/Uno.Templates/content/unoapp/MyExtensionsApp.1/Platforms/iOS/Info.plist‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@
3333
<string>Assets.xcassets/icon.appiconset</string>
3434
<key>UIApplicationSupportsIndirectInputEvents</key>
3535
<true/>
36+
<key>UIApplicationSceneManifest</key>
37+
<dict>
38+
<key>UIApplicationSupportsMultipleScenes</key>
39+
<true/>
40+
<key>UISceneConfigurations</key>
41+
<dict>
42+
<key>UIWindowSceneSessionRoleApplication</key>
43+
<array>
44+
<dict>
45+
<key>UISceneConfigurationName</key>
46+
<string>Default Configuration</string>
47+
<key>UISceneDelegateClassName</key>
48+
<string>SceneDelegate</string>
49+
</dict>
50+
</array>
51+
</dict>
52+
</dict>
3653

3754
<!--
3855
Adjust this to your application's encryption usage.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Foundation;
2+
using Uno.UI.Runtime.Skia.AppleUIKit;
3+
4+
namespace MyExtensionsApp._1.iOS;
5+
6+
[Register("SceneDelegate")]
7+
public class SceneDelegate : UnoUISceneDelegate
8+
{
9+
}

0 commit comments

Comments
 (0)