在 ContactsUI 中显示联系人的 EditView

Present EditView of Contacts in ContactsUI

我有一个显示联系人的 TableView。 当我单击单元格时,我想直接进入可编辑视图,而不是转到 CNContactViewController 并按 "edit Button"。 现在我有以下内容:

firstview

secondview

我想跳过第二步。这可能吗?

我使用的代码与苹果的相同:

let contacts = try contactStore.unifiedContactWithIdentifier
        (contactIdentifier!, keysToFetch: toFetch)
    let controller = CNContactViewController(forContact: contacts)
        controller.contactStore = contactStore
        controller.delegate = self
        controller.editing = true

        navigationController?
            .pushViewController(controller, animated: true)
        print(controller.editButtonItem())

    } catch {
        print(error)
    }

编辑:或多或少,为了说明,我正在尝试做的事情与 WhatsApp 在他们的应用程序中所做的相同!谢谢!!

你试过这种方法吗?

let toFetch = [CNContactViewController.descriptorForRequiredKeys()]

let contacts = try contactStore.unifiedContactWithIdentifier
        (contactIdentifier!, keysToFetch: toFetch)

let contactsViewController = CNContactViewController(forNewContact: contacts)
contactsViewController.delegate = self
contactsViewController.title = "Edit contact"
contactsViewController.contactStore = contactStore

self.navigationController?.pushViewController(contactsViewController, animated: true)