Home / IOS Development / ios – Push ViewController full screen from the bottom inside ModalView

ios – Push ViewController full screen from the bottom inside ModalView

Inside my app I have one MainVC. From there I present another ViewControllerB and I would like to push in there so this I achieve this:

let ViewControllerB = self.storyboard?.instantiateViewController(withIdentifier: "ViewControllerB") as! ViewControllerB
let navController = UINavigationController(rootViewController: communityVC)
self.present(navController, animated: true, completion: nil)

This works exactly the way I want it to work. However, in
ViewControllerB I would also like to push a certain ViewControllerC full screen from bottom and NOT just inside modalView. I call this:

let firstLaunchVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "FirstLaunchVC")
let transition:CATransition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
transition.type = CATransitionType.push
transition.subtype = CATransitionSubtype.fromTop
self.navigationController?.modalPresentationStyle = .fullScreen
self.navigationController!.view.layer.add(transition, forKey: kCATransition)
self.navigationController?.pushViewController(firstLaunchVC, animated: true)

This is pushing from bottom but not fullscreen. I also get this message in the terminal:

Set modalPresentationStyle once has been presented, it will have no effect until it is dismissed and resubmitted.

How can I push full screen from one presented ViewController?

I hope I made my problem clear. Let me know if you need more information on anything.

Source link