CNContactPickerViewController on a tab bar controller

I use CNContactPickerViewController to access contacts. And everything works fine until the part where I want to use this in Tabbar. In previous versions of ios, replacing the view with the collector worked well, but nothing showed in ios 9.

When I use this code for presentation, the tablet disappears.

[self presentViewController:my_picker animated:YES completion: nil]; 

I want the panel to always be visible and the contact list inside the tab.

Using ABPeoplePickerNavigationController . I replace the view with the following code and it works great.

 picker = [[ABPeoplePickerNavigationController alloc] init]; NSMutableArray *controllers = [NSMutableArray arrayWithArray [self.tabBarController viewControllers]]; int index = [controllers indexOfObject:self]; [controllers replaceObjectAtIndex: index withObject: picker]; 

Does anyone have a solution for this using?

+6
source share
1 answer

Just use these lines in your code,

 my_picker.modalPresentationStyle=UIModalPresentationOverCurrentContext; [self presentViewController:my_picker animated:YES completion:nil]; 

Now the tabBar will not disappear from your screen

+3
source

All Articles