Flutter macOS Embedder
FlutterAppLifecycleRegistrar Class Reference

#import <FlutterAppLifecycleDelegate.h>

Inheritance diagram for FlutterAppLifecycleRegistrar:
<FlutterAppLifecycleDelegate>

Instance Methods

(void) - addDelegate:
 
(void) - removeDelegate:
 
- Instance Methods inherited from <FlutterAppLifecycleDelegate>
(void) - handleWillFinishLaunching:
 
(void) - handleDidFinishLaunching:
 
(void) - handleWillBecomeActive:
 
(void) - handleDidBecomeActive:
 
(void) - handleWillResignActive:
 
(void) - handleDidResignActive:
 
(void) - handleWillHide:
 
(void) - handleDidHide:
 
(void) - handleWillUnhide:
 
(void) - handleDidUnhide:
 
(void) - handleDidChangeScreenParameters:
 
(void) - handleDidChangeOcclusionState:
 
(BOOL) - handleOpenURLs:
 
(void) - handleWillTerminate:
 

Properties

NSPointerArray * delegates [implementation]
 

Detailed Description

Propagates NSAppDelegate callbacks to registered delegates.

Definition at line 126 of file FlutterAppLifecycleDelegate.h.

Method Documentation

◆ addDelegate:

- (void) addDelegate: (NSObject<FlutterAppLifecycleDelegate>*)  delegate

Registers delegate to receive lifecycle callbacks via this FlutterAppLifecycleDelegate as long as it is alive.

delegate will only be referenced weakly.

Definition at line 76 of file FlutterAppLifecycleDelegate.mm.

76  :(NSObject<FlutterAppLifecycleDelegate>*)delegate {
77  [_delegates addPointer:(__bridge void*)delegate];
78  if (IsPowerOfTwo([_delegates count])) {
79  [_delegates compact];
80  }
81 }

Referenced by flutter::testing::TEST().

◆ removeDelegate:

- (void) removeDelegate: (NSObject<FlutterAppLifecycleDelegate>*)  delegate

Unregisters delegate so that it will no longer receive life cycle callbacks via this FlutterAppLifecycleDelegate.

delegate will only be referenced weakly.

Definition at line 83 of file FlutterAppLifecycleDelegate.mm.

83  :(NSObject<FlutterAppLifecycleDelegate>*)delegate {
84  NSUInteger index = [[_delegates allObjects] indexOfObject:delegate];
85  if (index != NSNotFound) {
86  [_delegates removePointerAtIndex:index];
87  }
88 }

Property Documentation

◆ delegates

- (NSPointerArray*) delegates
readwritenonatomicstrongimplementation

Registered delegates. Exposed to allow FlutterAppDelegate to share the delegate list for handling non-notification delegation.

Definition at line 15 of file FlutterAppLifecycleDelegate_Internal.h.


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