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 7416559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:31:15+00:00 2026-05-29T07:31:15+00:00

I have a uiwebview that plays a youtube video. How can I handle the

  • 0

I have a uiwebview that plays a youtube video. How can I handle the done button action?
Right now, when I tap the done button it changes back to my app main menu (not the menu that was supposed to dismiss to) and it just freezes. Can anyone help me please?

Ps: the menu where the uiwebview is located, was previously presented modally.

  • 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-05-29T07:31:16+00:00Added an answer on May 29, 2026 at 7:31 am

    The YouTube plug-in player is itself a modal view controller. It is returning to its presentingViewController when the done button is pressed. Its presentingViewController is not your modal view controller but is instead the viewController that called [presentModalViewController:animated:] to present your modal view controller. Since the original modal view controller is still active, the app behaves badly.

    To fix the problem,

    1) Track whether the modal view controller has been presented but not dismissed.

    2) In the viewDidAppear method of the presenting view controller, if the modal view controller was presented and not dismissed, dismiss and present it again.

    For example, in controller that is presenting the modal web view controller:

     - (void) presentModalWebViewController:(BOOL) animated {
          // Create webViewController here.
          [self presentModalViewController:webViewController animated:animated];
          self.modalWebViewPresented = YES;
      }
    
      - (void) dismissModalWebViewController:(BOOL) animated {
          self.modalWebViewPresented = NO;
          [self dismissModalViewControllerAnimated:animated];
      }
    
      - (void) viewDidAppear:(BOOL)animated {
          [super viewDidAppear:animated];
          if (self.modalWebViewPresented) {
               // Note: iOS thinks the previous modal view controller is displayed.
               // It must be dismissed first before a new one can be displayed.  
               // No animation is needed as the YouTube plugin already provides some.
               [self dismissModalWebViewController:NO];
               [self presentModalWebViewController:NO];
          }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIWebView that loads a YouTube video. The problem is, that if
I have a UIWebView that is supposed to open when the button is pressed,
How can I have a UIWebView load a file that is really an HTML
I have a UIWebView that loads a page with an html button. When user
I have a UIWebView that contains button with JS function, but the delegate method
I have a UIWebview that is loaded as a subview when a user selects
I have a UIWebView that loads a link, http://www.google.com/a/datacommsales.net . But I want to
I have a uiwebview that sends its loaded page url to a uitableview to
I have a UIWebView that loads a website. Then in - (void)webViewDidFinishLoad:(UIWebView *)webView I
I'm having a really confusing problem. I have a UIWebView that is contained within

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.