In iOS it is possible to create custom labels for phone numbers and email addresses. Is there a way to remove those created labels programatically (either with CNContacts or ABAddressBook)? In other words: I don't want to delete the custom label from a contact, I want to delete the "custom label" from the system so it doesn't show up at all when someone brings up the available available list.
Attached iOS 9 source code that creates a contact in the phone book with custom labels on the email field.
func createContact() {
let contactStore = CNContactStore()
let newContact = CNMutableContact()
newContact.givenName = "Chris"
newContact.familyName = "Last"
let homeEmail = CNLabeledValue(label: "RandomLabel", value: "[email protected]")
newContact.emailAddresses = [homeEmail]
do {
let saveRequest = CNSaveRequest()
saveRequest.addContact(newContact, toContainerWithIdentifier: nil)
try contactStore.executeSaveRequest(saveRequest)
}
catch {
NSLog("Save failed")
}
}