Behind Current Context option not available in Xcode Storyboard?
In this Stack Overflow answer to display clearColor of UIViewController over UIViewController , the user suggests using a parameter Over Current Context
for the modal view controller.
The goal is to create a transparent modal view controller through the Storyboard.
But the parameter is Over Current Context
not available. Only Current Context,
that doesn't create a transparent modal controller.
source to share
Struggling with this same issue for some time now and finally found a workaround.
Using Xcode 7.2.
Not sure why this is happening, but Over Current Context
not available. This project was created a while ago and I have a hunch that might be related.
As a test, I created a completely new project, and Over Current Context
a variant.
Since deleting and recreating my existing project was out of the question, I ended up doing the following:
-
Set
Presentation
the segment toDefault
. This is preparation for the next stage. -
On the destination view manager scene, set
Presentation
toOver Current Context
withinAttributes Inspector
.
I was able to successfully see the parent view controller underneath the semi-transparent modal.
Note:
I support iOS 8 and above, so I don't have to go around with setting modalPresentationStyle
on parent and child.
Failed attempts:
-
Setting
modalPresentationStyle
on.OverCurrentContext
on the target's view controllerprepareForSegue
didn't work for me because the Storyboard parameter seemed to override my code. -
Setting up
Defines Context
andProvides Context
didn't seem to make a difference. My guess is that they might come into play for some application architectures, not just my particular project.
source to share