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.

+3


source to share


3 answers


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.

current context

As a test, I created a completely new project, and Over Current Context

a variant.

in the current context

Since deleting and recreating my existing project was out of the question, I ended up doing the following:



  • Set Presentation

    the segment to Default

    . This is preparation for the next stage.

  • On the destination view manager scene, set Presentation

    to Over Current Context

    within Attributes Inspector

    .

destination view controller

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 controller prepareForSegue

    didn't work for me because the Storyboard parameter seemed to override my code.

  • Setting up Defines Context

    and Provides 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.

+2


source


Do you support iOS 7? Over Current Context - iOS 8 only.



0


source


IOS 7

can fully handle Over Current context

, just check use size classes

on File inspector

.

An example is here:

0


source







All Articles