September 2019
Beginner
512 pages
12h 52m
English
On the iOS side, the Swift code looks similar to the Kotlin code:
// SwiftHandsOnPlatformVersionPlugin.swiftpublic class SwiftHandsOnPlatformVersionPlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { // 1 let channel = FlutterMethodChannel(name: "hands_on_platform_version", binaryMessenger: registrar.messenger()) let instance = SwiftHandsOnPlatformVersionPlugin() registrar.addMethodCallDelegate(instance, channel: channel) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { result("iOS " + UIDevice.current.systemVersion) }}
The process looks similar to Android, but there are some small differences:
Read now
Unlock full access