Conversation
There was a problem hiding this comment.
Code Review
This pull request updates iOS documentation and code examples to support the UISceneDelegate lifecycle. It introduces FlutterSceneDelegate for handling scene callbacks and FlutterImplicitEngineDelegate to safely initialize plugins and platform channels when the application window is not yet available. Feedback was provided to correct parameter types in the Objective-C implementation of the FlutterSceneLifeCycleProvider protocol to ensure consistency and avoid potential compiler warnings.
| + return self; | ||
| + } | ||
| + | ||
| + - (void)addSceneLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate { |
There was a problem hiding this comment.
The parameter type for addSceneLifeCycleDelegate should match the FlutterSceneLifeCycleProvider protocol definition, which uses id<FlutterSceneLifeCycleDelegate> (or NSObject<FlutterSceneLifeCycleDelegate>*). Using NSObject<FlutterPlugin>* is unnecessarily restrictive and may cause compiler warnings or errors due to a signature mismatch with the protocol.
| + - (void)addSceneLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate { | |
| - (void)addSceneLifeCycleDelegate:(id<FlutterSceneLifeCycleDelegate>)delegate { |
| + [_sceneLifeCycleDelegate addDelegate:delegate]; | ||
| + } | ||
| + | ||
| + - (void)removeSceneLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate { |
There was a problem hiding this comment.
The parameter type for removeSceneLifeCycleDelegate should match the FlutterSceneLifeCycleProvider protocol definition, which uses id<FlutterSceneLifeCycleDelegate> (or NSObject<FlutterSceneLifeCycleDelegate>*).
| + - (void)removeSceneLifeCycleDelegate:(NSObject<FlutterPlugin>*)delegate { | |
| - (void)removeSceneLifeCycleDelegate:(id<FlutterSceneLifeCycleDelegate>)delegate { |
|
Visit the preview URL for this PR (updated for commit b468174): https://flutter-docs-prod--pr13279-fix-13274-3veb4wou.web.app |
Fixes #13274