Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8 ABPeoplePickerNavigationController Multiple Selection

I recently upgraded my iPhone and Xcode from iOS 6 to iOS 8 and I experienced the issue of the "default" action being performed when a phone number or email address is selected from the ABPeoplePickerNavigationController (by "default" action I mean, selecting a phone number starts calling that number and selecting an email address opens up a new email to that address).

I implemented the new

peoplePickerNavigationController:didSelectPerson:property:identifier:

method of ABPeoplePickerNavigationControllerDelegate, which resolved the "default" action issue, but now I am unable to select more than one email address or phone number before the ABPeoplePickerNavigationController is dismissed, whereas I used to be able to pick any number of email addresses and phone numbers in iOS 6 by returning NO from the

peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:

method which no longer seems to get called. I have also tried setting the predicateForSelectionOfProperty property of the ABPeoplePickerNavigationController to nil,

[NSPredicate predicateWithValue: YES] 

and

[NSPredicate predicateWithValue: NO],

but the ABPeoplePickerNavigationController still dismisses as soon as a property is selected.

Any idea how to prevent the ABPeoplePickerNavigationController from dismissing when a property is selected?

Thanks,

Vatche

like image 220
Vatche Avatar asked Apr 11 '26 10:04

Vatche


1 Answers

Moving the comment as an answer since it proved to be helpful :-)

I ended up subclassing ABPeoplePickerNavigationController and overriding dismissViewControllerAnimated to be able to decide whether to dismiss it or not, when a property is selected.

like image 199
alasker Avatar answered Apr 15 '26 09:04

alasker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!