Reputation: 23
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.sstatic.net/PcJNM.jpg
Upvotes: 0
Views: 1106
Reputation: 2377
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.
Upvotes: 1