0

In iOS 7+, how would one go about setting the navigation bar title view to be a stack of actions that trigger sorting a mutable array within the view controller?

For instance: Yik Yak's Navigation Bar https://i.stack.imgur.com/PcJNM.jpg

1 Answers1

1

You can set the navigation bar title to be a UIView with self.navigationItem.titleView. For example:

UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:@[@"New", @"Hot"]];
[segmentedControl sizeToFit];
// Configure your segmentedControl to your liking...

self.navigationItem.titleView = segmentedControl;

Also, can take a look at this one: UINavigationBar with buttons as title. Basically, you can customize the titleView as much as you want.

Community
  • 1
  • 1
DanielG
  • 2,237
  • 1
  • 19
  • 19