1

I have a SegmentedControl at the bottom of my EventsMasterViewController, but I also need it to be on the EventsDetailViewController.

The MasterViewController has a TableView that I use to list events, and the SegmentedControl acts as a "filter". However, clicking on an event needs to bring up the Event Detail View, but I need to keep the SegmentedControl at the bottom for navigation.

What's the best approach for this?

Balsamiq Wireframe

2 Answers 2

1

UISegmentedControl is not meant to be used for "navigation", filtering makes sense but why do you want to show these "filters" on the detail view where there is nothing to filter?

If you need navigation use UITabBarController...

If you need "filtering" use UISegmentedControl and add it to the bottom toolbar of your UINavigationController.

You will need to create one UISegmentedControl for each UIViewController but again mind you that "filters" on detail view make no sense.

UPDATE

In my opinion you should implement UITabBarController as the root controller to be used for your navigation. Then use UINavigationController + UIViewController for your master/detail views. And use one UISegmentedControl in your master controller to modify the table view output.

Sign up to request clarification or add additional context in comments.

2 Comments

I need both, but I don't want to have two separate controls. The filter also acts like navigation. If I am on the detail view for an event, and I click on upcoming events, it would just take me back to my previous ViewController and show the proper filter.
UX-wise, it's very bad idea and you will end up creating two controls anyway. Because each of the UISegmentedControl's will have to have different action assigned. In the first controller it will change it's view directly, but in the second, it will have to pop the current controller, navigate back and update the first controller's view. Which means you will have to create delegate/protocol on top of that.
0

it depends on what method you bring up the Detail View.if it's present,then it's impossible because it will always present from the bottom.if it's navigation controller,you can set the frame of the detail view smaller to let the segment can be seen.pay attention to the boundary.

4 Comments

I am using a Navigation Controller to contain my MasterViewController. I am afraid I do not understand your answer fully, though. I am relatively new to iOS.
set the detail view's property frame,set frame.size.height smaller,such as detailview.frame.size.height=400,then the segment can be seen
But right now they are completely separate UIViewControllers. How would I use two views in a single UIViewController then?
when you init the detail view,set it.then the main view under detail view will be seen partly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.