I am working on an existing objective c project , While reading Address Book UI Framework Reference for iOS i found the below classes have deprecated in iOS 9 .
( ABUnknownPersonViewController
, ABPersonViewController
, ABPeoplePickerNavigationController
, ABNewPersonViewController
)
What is the replacement of this .? Where i can find some document related this . any help appreciated . Thanks in advance .
Address Book UI Framework deprecated methods
6.1k Views Asked by Sat At
2
The
AddressBookUI
framework has been deprecated iniOS 9
, so better you should useContactsUI
Framework.It has many new features including all the features of
AddressBookUI
framework.So, in case if you are targeting the
iOS 9
specifically then you should go forContactsUI
Framework.To check that
AddressBookUI
framework is available for specificiOS
version you can do the following:Here is the complete code for that:
Just make sure that you ask the permission to read the contacts from device.
Reference link: https://gist.github.com/willthink/024f1394474e70904728
For replacement for
AddressBookUI
you need to useCNContactPickerViewController
. You can check the delegate methods which can be used to pickup the one or multiple contacts at a time.This will present a inbuilt
UIViewController
with all the contacts and you need to implement the delegate methods of it!CNContactPickerDelegate
reference: https://developer.apple.com/library/ios/documentation/ContactsUI/Reference/CNContactPickerDelegate_Protocol/