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 58 of file FlutterAppLifecycleDelegate.mm.

58  :(NSObject<FlutterAppLifecycleDelegate>*)delegate {
59  [_delegates addPointer:(__bridge void*)delegate];
60  if (IsPowerOfTwo([_delegates count])) {
61  [_delegates compact];
62  }
63 }

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 65 of file FlutterAppLifecycleDelegate.mm.

65  :(NSObject<FlutterAppLifecycleDelegate>*)delegate {
66  NSUInteger index = [[_delegates allObjects] indexOfObject:delegate];
67  if (index != NSNotFound) {
68  [_delegates removePointerAtIndex:index];
69  }
70 }

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: