我用它来显示联系人详细信息,它可以选择编辑联系人:
let toFetch = [CNContactViewController.descriptorForRequiredKeys()]
let cnContact = try contactStore!.unifiedContact(withIdentifier: contanctIdentifier, keysToFetch: toFetch)
let contactsViewController = CNContactViewController(for: cnContact)
contactsViewController.delegate = self
contactsViewController.allowsEditing = true
但我想显示编辑屏幕而不显示联系方式。
最佳答案
只需将 CNContactViewController(for: cnContact) 更改为
让 cvc = CNContactViewController(forNewContact: contact) 它会起作用
let contactsViewController = CNContactViewController(forNewContact: cnContact)
contactsViewController.delegate = self
contactsViewController.allowsEditing = true
关于ios - 在联系人 UI 中显示编辑联系人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40399296/