You should implement that screen manually. The screen on your screenshot is a UITableViewController
with a grouped UITableView
and a checkmark accessory indicator for the selected cell.
Here is the list for predefined phone number labels (from the Apple Developer Documentation):
╔════════════════════════════╦═════════════════════╗
║ String ║ Description ║
╠════════════════════════════╬═════════════════════╣
║ CNLabelHome ║ Home label ║
║ CNLabelWork ║ Work label ║
║ CNLabelPhoneNumberiPhone ║ iPhone number ║
║ CNLabelPhoneNumberMobile ║ Mobile phone number ║
║ CNLabelPhoneNumberMain ║ Main phone number ║
║ CNLabelPhoneNumberHomeFax ║ Home fax number ║
║ CNLabelPhoneNumberWorkFax ║ Work fax number ║
║ CNLabelPhoneNumberOtherFax ║ Other fax number ║
║ CNLabelPhoneNumberPager ║ Pager phone number ║
╚════════════════════════════╩═════════════════════╝
To display the localized names of these constants, use CNLabeledValue.localizedString(forLabel:)
(thanks, OOPer):
Swift
let localizedLabelString = CNLabeledValue<NSString>.localizedString(forLabel: CNLabelPhoneNumberiPhone)
print(localizedLabelString) //iPhone
Objective-C
NSString *localizedLabelString = [CNLabeledValue localizedStringForLabel: CNLabelPhoneNumberiPhone];
NSLog(@"%@", localizedLabelString); //iPhone
If you want to create a custom label for a contact, just use an arbitrary string for the label's name:
let phoneNumber = CNPhoneNumber(stringValue: "+18001234567")
let labeledPhoneNumber = CNLabeledValue(label: "arbitrary string", value: phoneNumber)
contact.phoneNumbers.append(labeledPhoneNumber)