0

I'm working on a project that has two different UITabBarControllers to represent two different states of the app. I can set the first UITabBarController once a user logs in and present the second when a button is pressed. However, I'm getting odd behavior when navigating within the second UITabBarController.

This is how I set the main tab bar.

let mainTabBar = MainTabBarController()
let mainMode = UINavigationController(rootViewController: mainTabBar)
UIApplication.shared.keyWindow?.rootViewController = mainMode

I use an identical method to navigate to the second tab bar.

let secondaryTabBar = SecondaryTabBarController()
let hiddenMode = UINavigationController(rootViewController: secondaryTabBar)
UIApplication.shared.keyWindow?.rootViewController = hiddenMode

However, when using the secondary UITabBarController, I see views from the main UITabBarController when navigating to an AVCaptureSession. More specifically, I see the last view (from which the secondaryTabBar is set) from the mainTabBar under the modal presentation of the capture session. Here's the problem point:

    let captureSession = CameraViewController()        
    navigationController?.present(captureSession, animated: true, completion: nil)
Explorer
  • 65
  • 1
  • 12

1 Answers1

0

I changed the modalPresentationStyle of the CameraViewController to .overCurrentContext and that solved the issue. Got it from here: Transparent background for modally presented viewcontroller

Explorer
  • 65
  • 1
  • 12