iosWebViewFix/ios/Classes/FlutterWebViewFactory.swift

32 lines
1.0 KiB
Swift
Raw Normal View History

2018-11-13 11:02:20 +00:00
//
// FlutterWebViewFactory.swift
2019-11-29 15:59:18 +00:00
// flutter_inappwebview
2018-11-13 11:02:20 +00:00
//
// Created by Lorenzo on 13/11/18.
//
import Flutter
import Foundation
public class FlutterWebViewFactory: NSObject, FlutterPlatformViewFactory {
private var registrar: FlutterPluginRegistrar?
2018-11-13 11:02:20 +00:00
init(registrar: FlutterPluginRegistrar?) {
super.init()
self.registrar = registrar
}
public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
return FlutterStandardMessageCodec.sharedInstance()
}
public func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) -> FlutterPlatformView {
let arguments = args as? NSDictionary
let webviewController = FlutterWebViewController(registrar: registrar!,
withFrame: frame,
viewIdentifier: viewId,
arguments: arguments!)
2018-11-13 11:02:20 +00:00
return webviewController
}
}