7

I'm using the CNContactPickerViewController to access contacts. And everything works fine until the part where I want to use this in Tabbar. In previous ios versions replacing the view by the picker worked well but in ios 9 does not show anything.

When I use this code to present view the tabbar disappears.

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

I want have the tabbar always visible and the contacts list inside the tab.

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

picker = [[ABPeoplePickerNavigationController alloc] init];

NSMutableArray *controllers = [NSMutableArray arrayWithArray [self.tabBarController viewControllers]];
int index = [controllers indexOfObject:self];

[controllers replaceObjectAtIndex: index withObject: picker];

Someone has a solution for this using?

  • Inacio Did you find solution to solve this problem?Please tell me how to show Tabbar view controller always in front of the contact picker view controller. Thanks in Advance! – Nandhakumar Kittusamy Jul 05 '17 at 06:23

1 Answers1

3

Just use these lines into your code ,

my_picker.modalPresentationStyle=UIModalPresentationOverCurrentContext;              

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

Now the tabBar won't disappear from your screen

Siva
  • 700
  • 6
  • 25