Swift 3 add new contact with phone and email information

后端 未结 3 1106
天涯浪人
天涯浪人 2021-02-13 06:48

I\'m trying to prompt the user to create a new contact and pass in information. (specifically a phone and email)

I\'ve found numerous examples of using a CNMutableContac

3条回答
  •  萌比男神i
    2021-02-13 07:35

    You Can Do Something Like This.

    extension ViewController: CNContactViewControllerDelegate {
    
        func showNewContactViewController() {
    
            let contactViewController: CNContactViewController = CNContactViewController(forNewContact: nil)
            contactViewController.contactStore = CNContactStore()
            contactViewController.delegate = self
            let navigationController: UINavigationController = UINavigationController(rootViewController: contactViewController)
            present(navigationController, animated: false) {
                print("Present")
            }
        }
    }
    

提交回复
热议问题