3

I have a situation where I have three viewcontroller let suppose VC1, VC2 and VC3, and I presented VC2 on VC1 modally with navigation controller like

   let nav = UINavigationController(rootViewController: VC2)
   self.present(nav, animation:true)

What I want push VC3 overfullscreen from VC2 without changing the Presentation style of VC2 in iOS 13+. currently its overCurrentContext.

golu_kumar
  • 231
  • 2
  • 9

1 Answers1

4

If you are adding the view controller VC3 as the root view controller of a navigation controller, then you need to modalPresentationStyle as overFullScreen to the navigation controller.

let nav = UINavigationController(rootViewController: VC3)
nav.modalPresentationStyle = .overFullScreen
self.present(nav, animation: true)

If you are directly presenting VC3, then do it like this.

VC3.modalPresentationStyle = .overFullScreen
self.present(VC3, animation: true)
Sumesh Sivan
  • 193
  • 7
  • 1
    Actually, what I want push not present VC3 overfullscreen from VC2 without changing the Presentation style of VC2. – golu_kumar Apr 07 '20 at 08:29
  • VC pushed from VC2 will not take full screen mode. It will perform inside VC2 only. So you will have to present VC3 if you need to make it full screen. – Sumesh Sivan Apr 07 '20 at 08:51