| Flutter macOS Embedder |

FlutterRunLoop.h
Go to the documentation of this file.
1 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRUNLOOP_H_
2 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRUNLOOP_H_
3
4 #import <Foundation/Foundation.h>
5
6 /**
7 * Interface for scheduling tasks on the run loop.
8 *
9 * Main difference between using `FlutterRunLoop` to schedule tasks compared to
10 * `dispatch_async` or `[NSRunLoop performBlock:]` is that `FlutterRunLoop`
11 * schedules the task in both common run loop mode and a private run loop mode,
12 * which allows it to run in mode where it only processes Flutter messages
13 * (`[FlutterRunLoop pollFlutterMessagesOnce]`).
14 */
15 @interface FlutterRunLoop : NSObject
16
17 /**
18 * Ensures that the `FlutterRunLoop` for main thread is initialized. Only
19 * needs to be called once and must be called on the main thread.
20 */
21 + (void)ensureMainLoopInitialized;
22
23 /**
24 * Returns the `FlutterRunLoop` for the main thread.
25 */
26 + (FlutterRunLoop*)mainRunLoop;
27
28 /**
29 * Schedules a block to be executed on the main thread.
30 */
31 - (void)performBlock:(void (^)(void))block;
32
33 /**
34 * Schedules a block to be executed on the main thread after a delay.
35 */
36 - (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;
37
38 /**
39 * Executes single iteration of the run loop in the mode where only Flutter
40 * messages are processed.
41 */
42 - (void)pollFlutterMessagesOnce;
43
44 @end
45
46 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRUNLOOP_H_
FlutterRunLoop
Definition: FlutterRunLoop.h:16
+[FlutterRunLoop mainRunLoop]
FlutterRunLoop * mainRunLoop()
Definition: FlutterRunLoop.mm:118
+[FlutterRunLoop ensureMainLoopInitialized]
void ensureMainLoopInitialized()
Definition: FlutterRunLoop.mm:111
-[FlutterRunLoop pollFlutterMessagesOnce]
void pollFlutterMessagesOnce()
Definition: FlutterRunLoop.mm:123