Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is ABPeoplePickerNavigationController slow?

When using ABPeoplePickerNavigationController it takes a moment (~0.5 sec) to load and display the control which is slower than the normal reaction time of other popups.

I came with the solution set the controller as a variable and access this pre-loaded object via:

[self presentViewController:self.peoplePicker animated:YES completion:nil];

Just out of curiosity, is there another way to fire up the picker without preloading it?

like image 348
Carsten Avatar asked May 21 '15 11:05

Carsten


1 Answers

Same here, I don't have the answer to solve it and I think that it could be an iOS 8 bug (UPDATE: yes it its, Apple confirmed it).

In my tests on iOS 7.x the ABPeoplePicker presentation time is less than 0.2 sec.

The problem appears only on iOS 8.x, and only the first time that you present the ABPeoplePicker. The ABPeoplePicker presentation takes about 3 sec in my application and about 1,5 sec in a sample application that do only the ABPeoplePicker presentation by pressing a button. I tested it both on simulator and device with ~20 contacts.

Pre-loading the instance doesn't change significantly the presentation time just as I expected. I've also tried to force the presentation on the main thread and to set animation to NO, but it's still slow on iOS 8.

The time profiler doesn't help me because I can't see an unexpected long time of computation.

While we wait for the supposed bug fix, I think that the best workarounds are to show an activity progress indicator while loading the ABPeoplePicker or to implement our own ABPeoplePicker.

I've implemented my own, you can find it on GitHub: VeeContactPicker, and of course use it! 😉

NEWS FROM APPLE:

Apple team answered to my bug report:

Apple Developer Relations 16-Jun-2015 00:36 AM

We believe this issue has been addressed in the latest iOS 9 beta. This is a pre-release iOS 9 update. Please refer to the release notes for complete installation instructions. Please test with this release. If you still have issues, please provide any relevant logs or information that could help us investigate.*

iOS 9 update

In iOS 9 the ABFramework has been deprecated for a new object-oriented contacts framework that comes with a new picker [see CNContactPicker]! Unfortunately it seems that the issue hasn't been resolved, the logic has been updated but the ViewController is still the same one as of iOS 8. So the CNContactPicker is still very slow to load and display the control...

I've reported the bug to Apple, waiting for news...

like image 177
andreacipriani Avatar answered Oct 16 '22 06:10

andreacipriani