You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/0000-ios-scenedelegate-and-resizing.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ N/A
30
30
31
31
## Motivation
32
32
33
-
Support for iOS scene lifecycle APIs that are the current preferred approach for apps. The secondary reason is to remediate the problem when the UIScene lifecycle will become mandatory in a future release of iOS.
33
+
Support for iOS scene lifecycle APIs that are the current preferred approach for apps. The secondary reason is to remediate the problem when the `UIScene` lifecycle will become mandatory in a future release of iOS.
34
34
35
35
As an example, the following key APIs are already deprecated:
36
36
@@ -42,7 +42,7 @@ As an example, the following key APIs are already deprecated:
To support `SceneDelegate` lifecycle, a new entrypoint for RN application initialization should be provided in `RCTReactNativeFactory`, which would be invoked from `SceneDelegate` lifecycle methods. The existing entrypoint from `AppDelegate` would be kept for backwards compatibility, making this an additive change. An example code snippet of a ``SceneDelegate`` using React Native proposed in this RFC would be:
45
+
To support `SceneDelegate` lifecycle, a new entrypoint for RN application initialization should be provided in `RCTReactNativeFactory`, which would be invoked from `SceneDelegate` lifecycle methods. The existing entrypoint from `AppDelegate` would be kept for backwards compatibility, making this an additive change. An example code snippet of a `SceneDelegate` using React Native proposed in this RFC would be:
46
46
47
47
```objc
48
48
@interfaceSceneDelegate ()
@@ -87,16 +87,16 @@ To support `SceneDelegate` lifecycle, a new entrypoint for RN application initia
87
87
88
88
### Migration from `AppDelegate` to `SceneDelegate`
89
89
90
-
Adoption of UIScene lifecycle requires the following actions:
90
+
Adoption of `UIScene` lifecycle requires the following actions:
91
91
92
92
* In application base code
93
93
* migration from `AppDelegate` as the primary point of lifecycle-related logic to `SceneDelegate`; for backwards compatibility, RN public API integration points will still be compatible with `AppDelegate` approach for users that may not want to migrate immediately
94
94
* invoke RN `RCTLinkingManager` methods from `SceneDelegate`:
95
95
* `scene:continueUserActivity:`
96
96
* `scene:openURLContexts:`
97
-
* update of the app's Info.plist to include a UIApplicationSceneManifest specifying the support and disabling multiple scenes capability
97
+
* update of the app's Info.plist to include a `UIApplicationSceneManifest` specifying the support and disabling multiple scenes capability
98
98
* In React Native code:
99
-
* migration of code that relies on `launchOptions` and deprecated `UIApplicationLaunchOptions`\* keys to UIScene lifecycle and UIScene.ConnectionOptions.userActivities
99
+
* migration of code that relies on `launchOptions` and deprecated `UIApplicationLaunchOptions`\* keys to `UIScene` lifecycle and `UIScene.ConnectionOptions.userActivities`
100
100
* In React Native code, RN native libraries’ code:
101
101
* migration of app lifecycle methods from application\* to scene\* as per [https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle](https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle)
102
102
* migration of code that relies on *any* *deprecated* `AppDelegate`-related APIs, which detailed description of is presented below
@@ -110,16 +110,16 @@ To enforce the user not to enable the `UIApplicationSceneManifest`.`UIApplicatio
110
110
In case of the RN app template, the iOS boilerplate code is limited only to basic bootstrapping of the application. This implies adjustments to:
111
111
112
112
* `Info.plist` \- add support for `SceneDelegate`
113
-
* ``SceneDelegate`.mm` \- implement the `SceneDelegate`
114
-
* ``AppDelegate`.mm` \- move app bootstrap code from here to ``SceneDelegate`.mm`
113
+
* `SceneDelegate.mm` \- implement the `SceneDelegate`
114
+
* `AppDelegate.mm` \- move app bootstrap code from here to `SceneDelegate.mm`
115
115
116
116
#### Migration: inspect usages of `RCTReactNativeFactory`
117
117
118
-
Support methods for initializing React Native from ``SceneDelegate``’s lifecycle methods.
118
+
Support methods for initializing React Native from `SceneDelegate`’s lifecycle methods.
119
119
120
120
#### Migration: `RCTLinkingManager`
121
121
122
-
The linking manager is using ``AppDelegate`` methods for handling URLs being opened at runtime. This needs to be migrated to `SceneDelegate`. To maintain backwards compatibility, we can implement both approaches and \- to ensure that only one is invoked at a given time \- conditionally check if the app is based on ``AppDelegate`` or has scenes to ensure only one listener handles the event. The Scene lifecycle options (`NSDictionary`) are adapted to the format of ``AppDelegate`` launchOptions (`NSDictionary` as well).
122
+
The linking manager is using `AppDelegate` methods for handling URLs being opened at runtime. This needs to be migrated to `SceneDelegate`. To maintain backwards compatibility, we can implement both approaches and \- to ensure that only one is invoked at a given time \- conditionally check if the app is based on `AppDelegate` or has scenes to ensure only one listener handles the event. The Scene lifecycle options (`NSDictionary`) are adapted to the format of `AppDelegate` launchOptions (`NSDictionary` as well).
0 commit comments