Flutter 从本机控制器返回到颤振应用程序
我正在从我的本地打开iOS中的新联系人屏幕,如下所示:Flutter 从本机控制器返回到颤振应用程序,flutter,flutter-navigation,flutter-ios,Flutter,Flutter Navigation,Flutter Ios,我正在从我的本地打开iOS中的新联系人屏幕,如下所示: let contact = CNMutableContact.init() let controller = CNContactViewController.init(forNewContact:contact) controller.delegate = self DispatchQueue.main.async { let navigation = UINavigationController .init(rootViewCon
let contact = CNMutableContact.init()
let controller = CNContactViewController.init(forNewContact:contact)
controller.delegate = self
DispatchQueue.main.async {
let navigation = UINavigationController .init(rootViewController: controller)
let viewController : UIViewController? = UIApplication.shared.delegate?.window??.rootViewController
viewController?.present(navigation, animated:true, completion: nil)
}
屏幕正确打开,问题是我无法返回到颤振应用程序。有一个取消按钮,但当我点击它时,什么也没有发生
如何从本机控制器返回?如何解决此问题:在类中添加以下方法(已从CNContactViewControllerDelegate扩展):
public func contactViewController(_ viewController: CNContactViewController, didCompleteWith contact: CNContact?) {
viewController.dismiss(animated: true, completion: nil)
}