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?
Because tab bar items are used to configure the tab bar, you must configure the tab bar item of each view controller before displaying the tab bar interface. If you are using Interface Builder to assemble your interface, you can specify the title and image as described in Creating a Tab Bar Interface Using a Storyboard.
For each content view controller in your tab bar interface, you must provide a UITabBarItem object with the image and text to be displayed in the corresponding tab. You can associate tab bar items with your view controllers at any time before displaying your tab bar interface.
A tab bar controller, of class UITabBarController, is a container view controller. We typically group together 3–5 together for better organisation. We switch from views by tapping the tab bar items in the bottom bar. Let’s add a function to setup the tabs.
Each content view controller manages a distinct view hierarchy, and the tab bar controller coordinates the navigation between the view hierarchies. This chapter describes how you configure and use tab bar controllers in your app.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With