我正在使用它来显示联系人详细信息,并且可以选择编辑联系人:
let toFetch = [CNContactViewController.descriptorForRequiredKeys()]
let cnContact = try contactStore!.unifiedContact(withIdentifier: contanctIdentifier, keysToFetch: toFetch)
let contactsViewController = CNContactViewController(for: cnContact)
contactsViewController.delegate = self
contactsViewController.allowsEditing = true
但我想显示编辑屏幕而不显示联系人详细信息。
答案 0 :(得分:0)
只需将CNContactViewController(for:cnContact)更改为
即可让cvc = CNContactViewController(forNewContact:contact)它会起作用
let contactsViewController = CNContactViewController(forNewContact: cnContact)
contactsViewController.delegate = self
contactsViewController.allowsEditing = true