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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:47:09+00:00 2026-06-11T10:47:09+00:00

I have a viewController I’ve built in storyboard. I also have a NSObject Subclass

  • 0

I have a viewController I’ve built in storyboard. I also have a NSObject Subclass which acts as my model, which sends and listens for API requests and responses. When a method fires in my model, I want to present a modal View of my viewController from whatever view happens to be visible at the time.

An example would be if my API hears “show this view” I want to show viewController regardless of what view is being shown.

Conceptually, how does one do this?

EDIT: I don’t know which view controller will be showing when I want to present my modal viewController. Also, I need to pass params from my model to the modalVC when it’s presented.

  • 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-11T10:47:10+00:00Added an answer on June 11, 2026 at 10:47 am

    I would send a notification from the model telling “someone” that some view needs be displayed.

    NSDictionary *userInfo = @{ @"TheViewKey": viewToDisplay];
    [[NSNoticationCenter defaultCenter] postNotificationName:@"NotificationThatThisViewNeedsToBeDisplayed" object:self userInfo:userInfo];
    

    And then on the delegate (or the active view controller) would register to this notification and handle the display.

    // self is the delegate and/or the view controller that will receive the notification
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleViewToDisplay:) name:@"NotificationThatThisViewNeedsToBeDisplayed" object:nil];
    

    If you put in the view controller remember to remove self from the observers when the view is not visible:

    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NotificationThatThisViewNeedsToBeDisplayed"];
    

    This way your model is decoupled from the presentation.

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

Sidebar

Related Questions

On my storyboard (shown above), I have a ViewController which holds an MKMapView with
I have a ViewController, and GameController class which is just subclassed from NSObject. The
I have a viewcontroller which can't be released since it is a subclass with
I have a ViewController class that has a property that is the model which
I have a viewcontroller in which I wanted it to be presented only in
I have a ViewController on which there is a UITextView. On swipe let/right i
I have a ViewController (with a MKMapView) which is pushed into, because of the
I have a ViewController that slides up. When you click Save it sends a
In my app I have a viewcontroller which is the delegate of NSFetchedResultsController and
Hey guys! I have this little problem: I have one ViewController which adds 2

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.