Unverified Commit 6931d5e3 authored by gaaclarke's avatar gaaclarke Committed by GitHub

Fixed usage of optional types in swift. (#43461)

parent e778686e
...@@ -4,7 +4,7 @@ import FlutterPluginRegistrant ...@@ -4,7 +4,7 @@ import FlutterPluginRegistrant
class ViewController: UIViewController { class ViewController: UIViewController {
var flutterEngine : FlutterEngine?; var flutterEngine : FlutterEngine?;
// Boiler-plate add-to-app demo. Not integration tested anywhere. // Boiler-plate add-to-app demo. Not integration tested anywhere.
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -18,10 +18,11 @@ class ViewController: UIViewController { ...@@ -18,10 +18,11 @@ class ViewController: UIViewController {
} }
@objc func handleButtonAction() { @objc func handleButtonAction() {
let flutterEngine = self.flutterEngine; if let flutterEngine = flutterEngine as? FlutterEngine {
GeneratedPluginRegistrant.register(with: flutterEngine); GeneratedPluginRegistrant.register(with: flutterEngine);
let flutterViewController = FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil)!; let flutterViewController = FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil);
self.present(flutterViewController, animated: false, completion: nil) self.present(flutterViewController, animated: false, completion: nil)
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment