此代码折叠了我的所有UIViewController层次结构
func openVCard(for cnContact: CNContact) {
let contactViewController = CNContactViewController(forUnknownContact: cnContact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
let navigationController = UINavigationController(rootViewController: contactViewController)
let doneButton = UIBarButtonItem(title: "Close", style: .done, target: nil, action: nil)
let flexibleSpaceButton = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
contactViewController.setToolbarItems([flexibleSpaceButton, doneButton, flexibleSpaceButton], animated: false)
navigationController.isToolbarHidden = false
contactViewController.edgesForExtendedLayout = []
present(viewController: navigationController, animated: true, completion: nil)
}
但CNContactViewController(forNewContact
这是苹果虫吗?
答案 0 :(得分:1)
你应该推 CNContactViewController 而不是现在。 我建议你观看WWDC 2015关于这个问题的演讲。
https://developer.apple.com/videos/play/wwdc2015/223/
30:00之后,您可以看到有关此问题的演示。