September 2019
Beginner
512 pages
12h 52m
English
In iOS, the process is very similar to Android, but there are a few points on syntax that differ. We register the factory like we did earlier, in the Creating an Android view section:
public class SwiftHandsOnPlatformViewsPlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let viewFactory = HandsOnTextViewFactory() registrar.register(viewFactory, withId: "com.example.handson/textview") }}
Then, we make the HandsOnTextViewFactory class able to return the iOS version of the view:
public class HandsOnTextViewFactory: NSObject, FlutterPlatformViewFactory { public func create( withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any? ) -> FlutterPlatformView ...Read now
Unlock full access