fixed bugs in ios version
This commit is contained in:
@@ -81,6 +81,7 @@ extension ZBarSymbolSet: Sequence {
|
||||
|
||||
self.addChildViewController(readerViewController)
|
||||
self.view.addSubview(readerViewController.view)
|
||||
readerViewController.didMove(toParentViewController: self)
|
||||
|
||||
readerViewController.view.addSubview(topView)
|
||||
topView.addSubview(textField)
|
||||
@@ -120,11 +121,14 @@ extension ZBarSymbolSet: Sequence {
|
||||
}
|
||||
|
||||
func sendResult(_ str: String) {
|
||||
platformChannel?.invokeMethod("findUserAndPurchase", arguments: [str, buttonState.searchType], result: { (result: Any?) in
|
||||
platformChannel?.invokeMethod("findUser", arguments: [str, buttonState.searchType], result: { (result: Any?) in
|
||||
if result is FlutterError {
|
||||
self.showErrorAlert(str)
|
||||
} else {
|
||||
self.presentingViewController?.dismiss(animated: false, completion: { self.dismiss(animated: true) })
|
||||
|
||||
self.dismiss(animated: true) {
|
||||
self.platformChannel?.invokeMethod("purchase", arguments: [result, str])
|
||||
}
|
||||
}
|
||||
print("result: \(result.debugDescription )")
|
||||
})
|
||||
@@ -139,6 +143,9 @@ extension ZBarSymbolSet: Sequence {
|
||||
)
|
||||
alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.default,handler: nil))
|
||||
|
||||
// if let appDelegate = UIApplication.shared.delegate as? FlutterAppDelegate {
|
||||
// appDelegate.window.rootViewController?.present(alertController, animated: true, completion: nil)
|
||||
// }
|
||||
self.present(alertController, animated: true, completion: nil)
|
||||
|
||||
}
|
||||
@@ -157,7 +164,7 @@ extension ZBarSymbolSet: Sequence {
|
||||
|
||||
readerViewController.view.frame = view.bounds
|
||||
topView.frame = CGRect(x: 0, y: 0, width: readerViewController.view.frame.size.width, height: 40)
|
||||
textField.frame = CGRect(x: settingButton.frame.maxX + 8, y: 5, width: readerViewController.view.frame.size.width - 50, height: 30)
|
||||
textField.frame = CGRect(x: settingButton.frame.maxX + 8 + 20 + 5, y: 5, width: readerViewController.view.frame.size.width - 50, height: 30)
|
||||
settingButton.frame = CGRect(x: 8, y: 10, width: 20, height: 20)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user