gpt4 book ai didi

ios - CNContactViewController 取消按钮不起作用

转载 作者:搜寻专家 更新时间:2023-10-30 22:04:02 25 4
gpt4 key购买 nike

我正在尝试使用内置的新联系人用户界面,但在使用取消按钮时出现意外行为。下面的代码可以调用新的联系人屏幕,但取消按钮只会清除屏幕条目,不会取消新的联系人屏幕。在内置的联系人应用程序中,点击取消返回到联系人列表屏幕。我想要取消按钮关闭窗口。

@IBAction func newTwo(sender: AnyObject) {
AppDelegate.getAppDelegate().requestForAccess { (accessGranted) -> Void in
if accessGranted {
let npvc = CNContactViewController(forNewContact: nil)
npvc.delegate = self
self.navigationController?.pushViewController(npvc, animated: true)
}
}

}

最佳答案

您是否实现了 CNContactViewControllerDelegate 方法?这是 a link to documentation

例如:

 func contactViewController(viewController: CNContactViewController, didCompleteWithContact contact: CNContact?) {

self.dismissViewControllerAnimated(true, completion: nil)
}

关于ios - CNContactViewController 取消按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36073064/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com