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