From b87006b59b7421785e9a9223b21cf8ed1e9058d2 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Mon, 25 Nov 2024 13:47:21 +1100 Subject: [PATCH] add some notes re: setMessageHandler() --- Sources/FlutterSwift/Channel/FlutterChannel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/FlutterSwift/Channel/FlutterChannel.swift b/Sources/FlutterSwift/Channel/FlutterChannel.swift index 8beecfd..25bf262 100644 --- a/Sources/FlutterSwift/Channel/FlutterChannel.swift +++ b/Sources/FlutterSwift/Channel/FlutterChannel.swift @@ -127,6 +127,11 @@ extension _FlutterBinaryMessengerConnectionRepresentable { } } + /// helper function to set the message handler for a channel. + /// `optionalHandler` is the handler function; if `nil`, then the message + /// handler will be removed (as if `removeMessageHandler()` was called`. + /// Otherwise, `block` is called to wrap the handler into a + /// `FlutterBinaryMessageHandler`. #if canImport(Android) @UIThreadActor #else