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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:42:59+00:00 2026-06-09T09:42:59+00:00

I want to build an application with one main view that will be on-screen

  • 0

I want to build an application with one main view that will be on-screen most of the time. Part of the view is constant and displays main controls. However, there is a special sub-view that depends on the state of the app. The state of the app is presented with a special ‘state object’. There can be only one ‘state object’ active at once, but they can have very different logic and should be presented with different user interfaces (within this special sub-view).

Obviously, I can handle it in the ViewController of the main view by analyzing the type of the current state object. I can create a biiiig switch with a lot of code specific to every possible class that the state object can have, and add some code there every time I add a new state object subclass… But this doesn’t sound like a good architecture to me. I want the state objects, or the different ViewControllers specific to them to take control of this special view instead. Unfortunately, I feel a bit lost in views, viewControllers & delegates & don’t understand how exactly can I achieve this.

  • 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-09T09:43:01+00:00Added an answer on June 9, 2026 at 9:43 am

    If you need to handle a lot of logic stuff in those slate views, you may want to make them as view controllers, then add to main view controller when you need them using container approach as shown in Session 102 – Implementing UIViewController Containment. Basically like this:

    [self addChildViewController:childViewController];
    [childViewController didMoveToParentViewController:self];
    [self.view addSubView:childViewController.view];
    

    You can even use this method for transition animation: transitionFromViewController: toViewController: duration: options: animations: completion:

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

Sidebar

Related Questions

I want to build a Facebook application that will be available only to those
I want to build flash application that can detect the user eyes color and
I want to build an application using Quicktime ActiveX interop that could run on
I want to build an application that exports user data of another app. The
I want to build an android application which will recognize my voice, convert it
I want to build a simple application with the MVVM pattern. This application will
I want to show a splash screen while my application's main form is loading
Let's say that I want to build 2 different sets of tablet-only layouts. One
I've got a Qt application that has two main windows. On Linux, when one
I want to build desktop application for Windows OS and use Google Drive to

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.