PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 6, 2022

[FIXED] What to set displayedPropertyKeys for CNContactPickerViewController in ios9

 November 06, 2022     abaddressbook, addressbookui, contacts, ios, ios9     No comments   

Issue

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.


Solution

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.



Answered By - Developer
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing