Commit 162d0009 authored by jzhang's avatar jzhang

no message

parent bbc6be6d
...@@ -16,7 +16,6 @@ class ViewController: UIViewController { ...@@ -16,7 +16,6 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
// Make a button to call the showFluttaaer function when pressed.
let button = UIButton(type: UIButton.ButtonType.custom) let button = UIButton(type: UIButton.ButtonType.custom)
button.addTarget(self, action: #selector(showFlutter), for: .touchUpInside) button.addTarget(self, action: #selector(showFlutter), for: .touchUpInside)
button.setTitle("Show Flutter!", for: UIControl.State.normal) button.setTitle("Show Flutter!", for: UIControl.State.normal)
...@@ -29,17 +28,17 @@ class ViewController: UIViewController { ...@@ -29,17 +28,17 @@ class ViewController: UIViewController {
binaryMessenger: flutterEngine.binaryMessenger) binaryMessenger: flutterEngine.binaryMessenger)
methodChannel?.setMethodCallHandler { [weak self] methodChannel?.setMethodCallHandler { [weak self]
(call: FlutterMethodCall, result: @escaping FlutterResult) in (call: FlutterMethodCall, result: @escaping FlutterResult) in
if let strongSelf = self { if let strongSelf = self {
switch call.method { switch call.method {
case "init": case "init":
result(self?.dicValueString(self!.getData())) result(self?.dicValueString(self!.getData()))
case "teachingEnd": case "teachingEnd":
strongSelf.navigationController?.popViewController(animated: true) strongSelf.presentedViewController?.dismiss(animated: true)
default: default:
// Unrecognized method name // Unrecognized method name
print("Unrecognized method name: \(call.method)") print("Unrecognized method name: \(call.method)")
}
} }
}
} }
} }
} }
......
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