I am trying to get the localized phone label value using CNContact.My attampt:
NSError *error = nil; CNContactFetchRequest *fetchRequest =[[CNContactFetchRequest alloc] initWithKeysToFetch:keysToFetch]; [addressBook enumerateContactsWithFetchRequest:fetchRequest error:&error usingBlock:^(CNContact * _Nonnull contact, BOOL * _Nonnull stop) { CNLabeledValue *phoneNumberValue = contact.phoneNumbers.firstObject; NSString *label = phoneNumberValue.label; NSLog(@"Phone Label: %@",label);
The problem is that the phone label returns the original value, for example _$!<Home>!$_ , _$!<Mobile>!$_ . But I need plain text, for example Home , Mobile . Is there a way to get a localized value using Contact interfaces. I do not want to use the address book because it is deprecated in iOS 9.
source share