Skip to content

Instantly share code, notes, and snippets.

@benjaminsnorris
Created December 30, 2014 18:32
Show Gist options
  • Save benjaminsnorris/35837610ff4a57c16320 to your computer and use it in GitHub Desktop.
Save benjaminsnorris/35837610ff4a57c16320 to your computer and use it in GitHub Desktop.
NavController Toolbar
- (void)setUpBottomToolbar {
self.navigationController.toolbar.tintColor = [UIColor orangeColor];
self.navigationController.toolbarHidden = NO;
self.viewPlayOrHistory = [[UISegmentedControl alloc] initWithItems:@[@"Standard", @"History"]];
self.viewPlayOrHistory.selectedSegmentIndex = 0;
UIBarButtonItem *viewSwitchButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.viewPlayOrHistory];
[self.viewPlayOrHistory addTarget:self action:@selector(switchViewToPlayOrHistory) forControlEvents:UIControlEventValueChanged];
UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
[self setToolbarItems:@[spaceItem,viewSwitchButtonItem,spaceItem] animated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment