Switching between UIViewControllers with UISegmentedControl

Robert J. Clegg

Right I have looked at a few SO questions on the subject and I am finding it difficult to come up with the correct solution here.

Requirements

I have a UITabBar based application. One of the tabs has a UINavigation controller with UISegmentedControl at the top allowing the user to switch between three different views. Each view will have a UITableView which will allow the user to navigate to another view. These views should be pushed onto to the navigation controller.

Problem

Now all the SO questions and Answers on the subject show how to switch between views. However I need the view I switch to, to allow pushing of another view onto the navigation stack. I am not sure this is even possible. I thought about UIViewController containment - however that would show a view being pushed onto the stack in a smaller window that the screen's bounds. Not what I am looking for.

Any ideas how I can solve this with storyboards and UIViewControllers?

UPDATE

Here is what I am trying to do: In the screenshot the container area is where I need to load other view controllers into. The UISegment control cannot go into the navigation bar as that space is used for something else. So that's why I think UIViewController containment might be better here?

enter image description here

LyricalPanda

So even though this isn't using separate TableViewControllers, you can use different custom UIViews that are hidden by default and become visible when you select it's corresponding button. This will unfortunately make it so you have all three view's logic in the same VC.

To get around this, you can try setting up some delegates and mimicking the TableViewController logic separation by sending out the didSelectTableAtIndexPath, UIGesture touches, etc into classes outside the ViewController to help keep your code cleaner.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why there is no retain loop between UINavigationController and UIViewControllers

From Dev

Switching between forms

From Dev

Navigating between UIViewControllers, retaining selected button image

From Dev

Switching between JPanels by keyboard

From Dev

Switching between activities automatically

From Dev

Switching between breakpoints

From Dev

Switching between two storyboards

From Dev

Switching between screens Libgdx

From Dev

Opentok switching between sessions

From Dev

Switching between UITextFields

From Dev

Switching between menuSubItems in shinyDashboard

From Dev

Switching between Fragments with button

From Dev

Interaction between two UIViewControllers on one screen in Swift

From Dev

Switching between css stylesheets

From Dev

How to pass data between UIViewControllers with protocols/delegates

From Dev

Switching between Server and Client

From Dev

R: Switching Between Graphs

From Dev

Switching between forms

From Dev

Switching between Server and Client

From Dev

Shortcut for switching between applications

From Dev

Switching between JPanels in a JFrame

From Dev

Switching between activities automatically

From Dev

Switching between UIViewControllers with UISegmentedControl

From Dev

Navigate between UIViewControllers and UISplitViewController

From Dev

NSArray blank - Passing between UIViewControllers

From Dev

Memory Accumilation, switching between UIViewControllers, what is ok?

From Dev

Switching Between Views with a UISegmentedControl

From Dev

How to jump between two UIViewcontrollers

From Dev

How to pass data between UIViewControllers without presenting it