| Flutter iOS Embedder |

Instance Methods | List of all members
FlutterEnginePluginSceneLifeCycleDelegate Class Reference

`#import <FlutterSceneLifeCycle_Internal.h>`

Inheritance diagram for FlutterEnginePluginSceneLifeCycleDelegate:

## Instance Methods
(void) | - addDelegate:
(BOOL) | - scene:willConnectToSession:options:
(void) | - sceneDidDisconnect:
(void) | - sceneWillEnterForeground:
(void) | - sceneDidBecomeActive:
(void) | - sceneWillResignActive:
(void) | - sceneDidEnterBackground:
(BOOL) | - scene:openURLContexts:
(BOOL) | - scene:continueUserActivity:
(BOOL) | - windowScene:performActionForShortcutItem:completionHandler:

## Detailed Description

Forwards callbacks to registered plugins.

Definition at line 511 of file FlutterSceneLifeCycle.mm.

## Method Documentation

## ◆ addDelegate:

- (void) addDelegate: |  | (NSObject<FlutterSceneLifeCycleDelegate>*) | delegate |

Definition at line 36 of file FlutterSceneLifeCycle.mm.

523 :(NSObject<FlutterSceneLifeCycleDelegate>*)delegate {
524 [_delegates addPointer:(__bridge void*)delegate];
525
526 // NSPointerArray is clever and assumes that unless a mutation operation has occurred on it that
527 // has set one of its values to nil, nothing could have changed and it can skip compaction.
528 // That's reasonable behaviour on a regular NSPointerArray but not for a weakObjectPointerArray.
529 // As a workaround, we mutate it first. See: http://www.openradar.me/15396578
530 [_delegates addPointer:nil];
531 [_delegates compact];
532 }

## ◆ scene:continueUserActivity:

- (BOOL) scene: |  | (UIScene*) | scene
continueUserActivity: |  | (NSUserActivity*) | userActivity

Definition at line 36 of file FlutterSceneLifeCycle.mm.

614 :(UIScene*)scene continueUserActivity:(NSUserActivity*)userActivity {
615 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
616 if ([delegate respondsToSelector:_cmd]) {
617 if ([delegate scene:scene continueUserActivity:userActivity]) {
618 // Only allow one plugin to process this event.
619 return YES;
620 }
621 }
622 }
623 return NO;
624 }
_delegates
NSPointerArray * _delegates
Definition: FlutterPluginAppLifeCycleDelegate.mm:38

## ◆ scene:openURLContexts:

- (BOOL) scene: |  | (UIScene*) | scene
openURLContexts: |  | (NSSet<UIOpenURLContext*>*) | URLContexts

Definition at line 36 of file FlutterSceneLifeCycle.mm.

600 :(UIScene*)scene openURLContexts:(NSSet<UIOpenURLContext*>*)URLContexts {
601 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
602 if ([delegate respondsToSelector:_cmd]) {
603 if ([delegate scene:scene openURLContexts:URLContexts]) {
604 // Only allow one plugin to process this event.
605 return YES;
606 }
607 }
608 }
609 return NO;
610 }

## ◆ scene:willConnectToSession:options:

- (BOOL) scene: |  | (UIScene*) | scene
willConnectToSession: |  | (UISceneSession*) | session
options: |  | (UISceneConnectionOptions*) | connectionOptions

Definition at line 36 of file FlutterSceneLifeCycle.mm.

536 :(UIScene*)scene
537 willConnectToSession:(UISceneSession*)session
538 options:(UISceneConnectionOptions*)connectionOptions {
539 BOOL handledByPlugin = NO;
540 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
541 if ([delegate respondsToSelector:_cmd]) {
542 // If this event has already been consumed by a plugin, send the event with nil options.
543 // Only allow one plugin to process the connection options.
544 if ([delegate scene:scene
545 willConnectToSession:session
546 options:(handledByPlugin ? nil : connectionOptions)]) {
547 handledByPlugin = YES;
548 }
549 }
550 }
551 return handledByPlugin;
552 }

## ◆ sceneDidBecomeActive:

- (void) sceneDidBecomeActive: |  | (UIScene*) | scene |

Definition at line 36 of file FlutterSceneLifeCycle.mm.

572 :(UIScene*)scene {
573 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
574 if ([delegate respondsToSelector:_cmd]) {
575 [delegate sceneDidBecomeActive:scene];
576 }
577 }
578 }

## ◆ sceneDidDisconnect:

- (void) sceneDidDisconnect: |  | (UIScene*) | scene |

Definition at line 36 of file FlutterSceneLifeCycle.mm.

554 :(UIScene*)scene {
555 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
556 if ([delegate respondsToSelector:_cmd]) {
557 [delegate sceneDidDisconnect:scene];
558 }
559 }
560 }

## ◆ sceneDidEnterBackground:

- (void) sceneDidEnterBackground: |  | (UIScene*) | scene |

Definition at line 36 of file FlutterSceneLifeCycle.mm.

590 :(UIScene*)scene {
591 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
592 if ([delegate respondsToSelector:_cmd]) {
593 [delegate sceneDidEnterBackground:scene];
594 }
595 }
596 }

## ◆ sceneWillEnterForeground:

- (void) sceneWillEnterForeground: |  | (UIScene*) | scene |

Definition at line 36 of file FlutterSceneLifeCycle.mm.

564 :(UIScene*)scene {
565 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
566 if ([delegate respondsToSelector:_cmd]) {
567 [delegate sceneWillEnterForeground:scene];
568 }
569 }
570 }

## ◆ sceneWillResignActive:

- (void) sceneWillResignActive: |  | (UIScene*) | scene |

Definition at line 36 of file FlutterSceneLifeCycle.mm.

582 :(UIScene*)scene {
583 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
584 if ([delegate respondsToSelector:_cmd]) {
585 [delegate sceneWillResignActive:scene];
586 }
587 }
588 }

## ◆ windowScene:performActionForShortcutItem:completionHandler:

- (BOOL) windowScene: |  | (UIWindowScene*) | windowScene
performActionForShortcutItem: |  | (UIApplicationShortcutItem*) | shortcutItem
completionHandler: |  | (void(^)(BOOL succeeded)) | completionHandler

Definition at line 36 of file FlutterSceneLifeCycle.mm.

628 :(UIWindowScene*)windowScene
629 performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
630 completionHandler:(void (^)(BOOL succeeded))completionHandler {
631 for (NSObject<FlutterSceneLifeCycleDelegate>* delegate in _delegates.allObjects) {
632 if ([delegate respondsToSelector:_cmd]) {
633 if ([delegate windowScene:windowScene
634 performActionForShortcutItem:shortcutItem
635 completionHandler:completionHandler]) {
636 // Only allow one plugin to process this event.
637 return YES;
638 }
639 }
640 }
641 return NO;
642 }

The documentation for this class was generated from the following files:

- shell/platform/darwin/ios/framework/Source/FlutterSceneLifeCycle.mm
- shell/platform/darwin/ios/framework/Source/FlutterSceneLifeCycle_Internal.h