ioscocoa-touchcontacts-framework

How to open Add Contact form through app


How to open native Contact form with some prefilled data using Contacts Framework.


Solution

  • Add ContactsUI framework. Import it in your viewcontroller like this

     import ContactsUI
    

    Add and Call this following method from respective viewcontroller.

      func addExistingContact() {
        if #available(iOS 9.0, *) {
            let contactPicker = CNContactPickerViewController()
            contactPicker.delegate = self
            self.presentViewController(contactPicker, animated: true, completion: nil)
        } else {
            // Fallback on earlier versions
        }
    
    }