iosswiftswift3ios-contacts

How to convert CNContact to CNMutableContact?


I need to get contact, change it, and store back.

CNContactStore().unifiedContacts gives me CNContact instance, but CNSaveRequest().update requires CNMutableContact.

How to convert CNContact to CNMutableContact?


Solution

  • Just found a way:

    let mutableContact = contact.mutableCopy() as! CNMutableContact