B2Fq
B2Fq

Reputation: 916

UIViewController presented without background

When im present new VC background is clear and I can see previous VC.

Second VC is empty (without any view)

How FIX?

let vc = AddScrollVC()
let navController = UINavigationController(rootViewController: vc)
navController.modalPresentationStyle = .overFullScreen
present(navController, animated: true)

enter image description here

Second VC is presented, shown only button in navBar

Upvotes: 0

Views: 89

Answers (2)

Rahul John
Rahul John

Reputation: 508

Change the code like this, This is work fine for me

let VC = PresentVC()
VC.modalPresentationStyle = .overFullScreen
self.present(VC, animated: true, completion: nil)

Upvotes: 0

Rahul John
Rahul John

Reputation: 508

You can solve the issue with replacing this code

let VC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "PresentVC") as! PresentVC
VC.modalPresentationStyle = .overFullScreen
self.present(VC, animated: true, completion: nil)

Upvotes: 0

Related Questions