Ios – Presenting a new View Controller Keeping Tab Bar

iosiphoneuitabbarcontrolleruiviewcontroller

I'm currently developing an iPhone App supporting iOS6+.
The structure of the application has a UITabBarController as the root controller with a number of view controllers assigned to that. On one of the tabs is a UITableViewController with a list of items that, when selected, displays a detail view of that item using a push seque.

However, I also have another screen that allows QR scanning. When the QR code is scanned, the result is processed to retrieve an id that I then want to display the detail view page for the matching item (as above).

I can get this to display using the following code in the QR scanning view controller, but this loses the tab bar and any hope of navigation at this point.

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

Is there any way that I can present the detail view controller, but still keep the tab bar (and ideally the navigation bar) that I'd get when going through the UITableView route?
Everything that I've found so far references presentModalViewController but that seems to have been deprecated as of iOS6 and replaced with presentViewController.

Thanks in advance for any help or suggestions,

PhilHalf

Best Answer

The modal view will come over all view replacing eventually a tabBarController, NavigationCOntroller etc...

Modal view :
Can works for all view controllers
Is over all other view and need to be pop programatically (adding a button back manually for example)

Push View :
Only works in navigation controllers
Add automatically a back button in the navigationController

I believe that what you want is a pushView which will be integrate in your navigationController :

[self.navigationController pushViewController:viewController animated:YES];