0
votes

I have been trying to solve this for a while with a variety of people suggesting several different ways to achieve this and none of them working for me.

I am trying to display a view controller over the current context with a clear background. However each time I perform the segue the view controller underneath is removed from the view hierarchy.

Here is the presenting view controller. Presenting View Controller

And here is the current state when presenting the view modally. Modal popup

As the segue is taking place the modal has the correct transparency effect however when the segue completes the background turns black indicating the view controller has been removed from the hierarchy.

Now many suggestions focus on setting up the modal in code however all these settings are available in the storyboard and I prefer to leave things like that in there. As suggested here I have setup my view controllers like this however I still have the above effect.

Here is my storyboard setup.

Presenting view controller settings Presenting view controller settings

Segue settings Segue settings

Modal view controller settings Modal view controller settings

Any help would be much appreciated.

1

1 Answers

1
votes

you can make those view controllers child of the VC you want to present them on here, by making one view controller child of another, you can add view of child VC as a subview to the view of parent VC

you can then play with transparency/color of child VC view's

This can also be helpful tutorial

presenting view controller on top of the current one won't work for you, you will have add other view controller as child for the current one and then add it's view as subview to the current VC's view. then if you clear background color for child VC's view it will appear transparent and show you previous VC's view in background

Edit: you can achieve the same effect using presentation controller here