KexAri
KexAri

Reputation: 3977

Presenting a view controller shows navigation controller under it

I currently have tab bar controller. From one of the tabs I present a controller like so:

present(vc1, animated: true, completion: nil)

Now this view controller covers the the tab bar controller. From this controller I now want to present another controller. Again I use

present(vc2, animated: true, completion: nil)

I also have self.definesPresentationContext = true set in vc1.

This controller is not full screen size (it's a dialogue box) and it doesn't show vc1 underneath. Instead it shows the tab bar controller. When I dismiss it vc1 is shown again. What am I doing wrong here? I want to present from v1 and show vc1 underneath not the tab bar controller.

Upvotes: 0

Views: 58

Answers (1)

Twitter khuong291
Twitter khuong291

Reputation: 11702

Set

vc2.modalPresentationStyle = .overCurrentContext
vc2.view.backgroundColor = .clear

before present(vc2, animated: true, completion: nil)

Upvotes: 1

Related Questions