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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:21:43+00:00 2026-06-03T05:21:43+00:00

I have encapsulated all my table view logic on a UITableViewController that is linked

  • 0

I have encapsulated all my table view logic on a UITableViewController that is linked to a view. This was done using storyboards.

I would like to embed this logic and view within another view controller / view (kind of like a header information with a scrollable table beneath.)

I have the following components:
CustomViewController which is linked to a UIView (dragged in from storyboard)
CustomTableViewController which is linked to a UITableView (dragged in from storyboard)

Essentially I am trying to mimic the scenario of the Stopwatch in the iOS clock app

  • What is the beast approach to this?
  • How is it done programatically?
  • Can this be done on the storyboard somehow?

Any help would be greatly appreciated. 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-03T05:21:44+00:00Added an answer on June 3, 2026 at 5:21 am

    Ok figured it out. This solution is iOS 5 specific since this feature was added there. This method works with storyboards.

    Setup: The intention is to host one view controllers view and logic within another controller.

    1. Since there is no intrinsic way to reference the child view controller in the storyboard, we need to give the view controller a name. This can be done by filling out the “Identifier” attribute on the controller in the storyboard. NOTE: Make sure you are giving the controller the identifier and not the controllers view.

    2. Instantiate the controller you want to aggregate. This can be done from the hosting controller.

      UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"ControllerIdentifier"];
      
    3. Add the child controller to the parent controller

      [self addChildViewController: controller];
      
    4. Add the child controllers view to the parent controllers view. Note if you have a place holder view in the parent controller you wish to add the child view to, then this is where you do it. Here I add it the a UIView called stage in the parent controller.

      [self clearStage]; 
      [self.stageView addSubview:controller.view];
      presentedController.view.frame = self.stageView.bounds;
      

    And that is it. Pretty simple. I have used it successfully with switching controllers and view in a home made tab control. The sub controller enlists its views in the view lifecycle, so the viewDidLoad, etc all work as expected in this child view controller.

    Hopes this helps someone.

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

Sidebar

Related Questions

I have encapsulated a backup database command in a Try/Catch and it appears that
I have this.... function MyFunction() { var myVar = I think I am encapsulated;
I have done a few projects lately using a Database Object super class which
I have an application which uses a SQL database. This is encapsulated by a
I have a method that queues some work to be executed asynchronously. I'd like
I have two simple tables in my database. A card table that contains Id,
I have a view model that needs to encapsulate a couple of many-to-many relationships.
I would like to do something like this: std::wistream input = std::wifstream(text); if (!input)
in a PHP project we already have separated business logic from database access. All
I have a form which encapsulates all the functionality, but works with a concrete

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.