@@ -47,9 +47,28 @@ UIKit won't call AppDelegate methods related to UI state.
4747
4848## Migration guide for Flutter apps
4949
50- The Flutter CLI will automatically migrate your app when you run ` flutter run `
51- or ` flutter build ios ` if your AppDelegate has not been customized. Otherwise,
52- you must migrate manually.
50+ ### Auto-Migrate (Experimental)
51+
52+ The Flutter CLI can automatically migrate your app if your AppDelegate has not
53+ been customized.
54+
55+ 1 . Enable UIScene Migration Feature
56+
57+ ``` console
58+ flutter config --enable-uiscene-migration
59+ ```
60+
61+ 2 . Build or run your app
62+
63+ ``` console
64+ flutter run
65+ or
66+ flutter build ios
67+ ```
68+
69+ If the migration succeeds, you will see a log that says "Finished migration to
70+ UIScene lifecycle". Otherwise, it warns you to migrate manually using the
71+ included instructions. If the migration succeeds, no further action is required!
5372
5473### Migrate AppDelegate
5574
@@ -206,6 +225,50 @@ As XML:
206225</dict >
207226```
208227
228+ ### Create a SceneDelegate (Optional)
229+
230+ If you need access to the ` SceneDelegate ` , you can create one by
231+ subclassing ` FlutterSceneDelegate ` .
232+
233+ 1 . Open your app in Xcode
234+ 2 . Right click the ** Runner** folder and select ** New Empty File**
235+
236+ ![ New Empty File option in Xcode] ( /assets/images/docs/breaking-changes/uiscene-new-file.png )
237+
238+ For Swift projects, create a ` SceneDelegate.swift ` :
239+
240+ ``` swift title=my_app/ios/Runner/SceneDelegate.swift
241+ import Flutter
242+ import UIKit
243+
244+ class SceneDelegate : FlutterSceneDelegate {
245+
246+ }
247+ ```
248+
249+ For Objective-C projects, create a ` SceneDelegate.h ` and ` SceneDelegate.m ` :
250+
251+ ``` objc title=my_app/ios/Runner/SceneDelegate.h
252+ #import < Flutter/Flutter.h>
253+ #import < UIKit/UIKit.h>
254+
255+ @interface SceneDelegate : FlutterSceneDelegate
256+
257+ @end
258+ ```
259+
260+ ``` objc title=my_app/ios/Runner/SceneDelegate.m
261+ #import " SceneDelegate.h"
262+
263+ @implementation SceneDelegate
264+
265+ @end
266+ ```
267+
268+ 3 . Change the "Delegate Class Name" (` UISceneDelegateClassName ` ) in the
269+ Info.plist from ` FlutterSceneDelegate ` to
270+ ` $(PRODUCT_MODULE_NAME).SceneDelegate ` .
271+
209272## Migration guide for Flutter plugins
210273
211274Not all plugins use lifecycle events. If your plugin does, though, you will
0 commit comments