我试图在iOS 10中显示Contacts与ContactsUI框架添加新的联系人视图.我用来呈现CNContactViewController的代码如下:
let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
self.present(contactViewController, animated: false) {}
Run Code Online (Sandbox Code Playgroud)
但每次执行代码时,应用程序都会被冻结,我得到以下错误日志的三倍以上:[CNUI ERROR]联系人视图延迟出现超时
欢迎任何解释,
And*_*voy 31
我找到了解决方法.只需打包CNContactViewController进去UINavigationController,一切都会好的.
@JackRobson的特殊代码示例
let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
let navigationController = UINavigationController(rootViewController: contactViewController)
self.present(navigationController, animated: false) {}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2135 次 |
| 最近记录: |