Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8965491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:48:55+00:00 2026-06-15T16:48:55+00:00

This only accours if you are presenting in a view controller that is managed

  • 0

This only accours if you are presenting in a view controller that is managed by a navigation controller.

The reproduction steps are:

1 – Present a view controller using UIModalPresentationCurrentContext

self.definesPresentationContext = YES;
ViewController* viewController = [[ViewController alloc] init];
viewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[presentOnViewController presentViewController:viewController animated:YES completion:nil];

2 – Present a view controller over the top using the default full screen presentation style

ViewController* viewController = [[ViewController alloc] init];
[self presentViewController:viewController animated:YES completion:nil];

3 – Dismiss the top presented view controller (the full screen one)

[self dismissViewControllerAnimated:YES completion:nil];

Now the problem is the 2nd view controller (presented using UIModalPresentationCurrentContext) disappears. Also it is impossible to present another view controller using UIModalPresentationCurrentContext, because the system thinks its still there.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:48:56+00:00Added an answer on June 15, 2026 at 4:48 pm

    I believe the issue is a bug in the framework. As mentioned it only occurs when the presenting in a view controller managed by a navigation controller. There is a nasty work around which uses the containment API. It creates a dummy view controller which views are presented from. The steps are:

    1 – When presenting a view in context who’s parent is a navigation controller, use a dummy view controller:

    - (void)presentInContext
    {
        UIViewController* presentOnViewController = self;
    
        if ([self.parentViewController isKindOfClass:[UINavigationController class]])
        {
            // Work around - Create an invisible view controller
            presentOnViewController = [[DummyViewController alloc] init];
            presentOnViewController.view.frame = self.view.frame;
    
            // Containment API
            [self addChildViewController:presentOnViewController];
            [self.view addSubview:presentOnViewController.view];
            [presentOnViewController didMoveToParentViewController:self];
    
            presentOnViewController.definesPresentationContext = YES;
        }
    
        ViewController* viewController = [[ViewController alloc] init];
        viewController.modalPresentationStyle = UIModalPresentationCurrentContext;
        [presentOnViewController presentViewController:viewController animated:YES completion:nil];
    }
    

    2 – When dismissing the view controller tidy up

    - (void)dismissSelf
    {
        __weak UIViewController* presentingViewController = self.presentingViewController;
    
        [self dismissViewControllerAnimated:YES completion:^{
    
            // Remove the dummy view controller
            if ([presentingViewController isKindOfClass:[DummyViewController class]])
            {
                [presentingViewController willMoveToParentViewController:nil];
                [presentingViewController.view removeFromSuperview];
                [presentingViewController removeFromParentViewController];
            }
        }];
    }
    

    Thats it… The fix is dirty, but does the trick with no visual flicker.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This only happens in some IE's. Here: http://animactions.ca/Animactions/volet_entreprise.php You may notice that when you
This only happens in IE. I'm using swfobject and loading the flash vars as
This only returns User doesn't exist. Im guessing it is the count that is
This only checks PATH variable? Can I override path by using say PERL=/usr/somelocal/perl Thanks
EDIT: This only happens with IE (tested on IE10) I have a app that
Is there a way to do this only using javascript? thank you!
Before I begin, I should tell you that this only happens in iOS 5.1.
I am using a gradient for my button background color, and this only works
I have a very weird problem. This ONLY affects Firefox on Mac, using the
This only happens when using the compatibility library for pre-3.0 devices I'm getting an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.