I am building an app that shows the camera (ImagePickerController) when the tab is selected for the first time. Since it is modally presented by its view controller, it takes the entire screen and I have placed a close button which dismisses the controller and gives access back to the tabs (6 of them). Next time the camera tab is selected though, the camera does not launch but just gives me an empty window, i.e. the View Controller. I have created my app with Storyboard and use a custom camera overlay – not the standard UIImagePickerController overlay.
I dismiss the camera with: [self.picker dismissModalViewControllerAnimated:NO];
Can someone kindly guide me on how to always present the camera in this view controller?
Since it is working the first time and not subsequent times, I’m guessing that you are displaying the camera view controller in the
viewDidLoadmethod of the tab’s view controller. Move that code toviewWillAppearand it should display every time that you go to the tab.Alternatively, you could display the camera in the
UITabBarDelegatetabBar:didSelectItem:method.