pkc
pkc

Reputation: 8516

What to set displayedPropertyKeys for CNContactPickerViewController in ios9

For lower than ios9, I used to write

picker.displayedProperties = @[@(kABPersonEmailProperty)];

For ios9, what will be the displayedPropertyKeys ( picker.displayedPropertyKeys = @[@(????)]; )

Note:- picker is ABPeoplePickerNavigationController for ios8 and CNContactPickerViewController for ios9.

I am basically fetching the contacts using Contacts framework.

Upvotes: 1

Views: 1908

Answers (1)

Developer
Developer

Reputation: 78

Use the following:

Objective-C

picker.displayedPropertyKeys = @[CNContactEmailAddressesKey];

Swift 5.2

picker.displayedPropertyKeys = [CNContactPhoneNumbersKey]

A full list of available keys can be found at https://developer.apple.com/documentation/contacts/contact_keys.

Upvotes: 1

Related Questions