Skip to content

Instantly share code, notes, and snippets.

@rxlabz
Last active June 16, 2017 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rxlabz/f48764327dfabd67df6bb94451b862d2 to your computer and use it in GitHub Desktop.
Save rxlabz/f48764327dfabd67df6bb94451b862d2 to your computer and use it in GitHub Desktop.
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