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

  • Home
  • SEARCH
  • 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 8423625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:46:26+00:00 2026-06-10T03:46:26+00:00

When my app receives a notification it handles it like this opening a specific

  • 0

When my app receives a notification it handles it like this opening a specific view:

    UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
    if (localNotif) {
        NSLog(@"Recieved Notification  didFinishLaunchingWithOptions %@",localNotif);
        [theLastPresentedViewController presentViewController:myVC animated:YES completion:nil];
    }

Basically my question is how to get access to the last presented ViewController theLastPresentedViewController so I can present myView on top of it ?

While the app uses a tabBarViewController as the basis, I present other viewControllers on top of other views so there is no way to know which ViewController has beed presented as the last one.

Do I have to manually remember each ViewController I present, so when the app launches I can access the last one or is there a way to directly access the last visible viewController of the app ?

Since the user can just press the HOME Button and exit the app there is no way to know which view was shown at this moment. It would also be OK to dismiss all these views from the stack until the tabBarViewController is reached.

Many thanks!

  • 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-10T03:46:27+00:00Added an answer on June 10, 2026 at 3:46 am

    I found this to access the top most window/view:

    [[[UIApplication sharedApplication] keyWindow] addSubview:someView]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If my app is closed , and the iphone receives a push notification for
I found some weird behavior in push notification. My iPod app receives push notifications
I'd like to use boost::signals2 to handle event notification in my C++ app. I'm
I'm using Apple's view controllers quite alot in my app (like MFMessageComposeViewController and ABPeoplePickerNavigationController
When my app receives a Push Notification, application:didReceiveRemoteNotification: receives the data. When the user
When my App is not running and receives a Push Notification, if I click
My app receives numerous text strings which may or may not contain a URL
What would be the best way to display a dialog whenever my app receives
I'm trying to debug an issue that only occurs when my iPhone app receives
I have an App which receives a SQLite database to read some data and

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.