Skip to content

Instantly share code, notes, and snippets.

@rxlabz
Last active Jun 16, 2017
Embed
What would you like to do?
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController;
let flutterChannel = FlutterMethodChannel.init(name: "plugin_demo", binaryMessenger: controller);
flutterChannel.setMethodCallHandler({
(call: FlutterMethodCall, result: FlutterResult) -> Void in
if ("getPlatformVersion" == call.method) {
result("iOS " + UIDevice.current.systemVersion);
} else {
result(FlutterMethodNotImplemented);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment