Commit 162d0009 authored by jzhang's avatar jzhang

no message

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