Xcode - How to add toolbar to UITableViewController
1 answer
If yours UITableViewController
is built in UINavigationController
, the navigation controller comes with a toolbar. You won't need to add your own.
The navigation controller navigation bar is hidden by default. You can enable it:
-
Parameter Check Shows a toolbar in the Interface Interface Attributes inspector pane, or
-
Setting the visibility of the toolbar in code:
[self.navigationController setToolbarHidden:NO animated:YES];
Including a Storyboard toolbar has the advantage that you can drag and drop items onto it using the Interface Builder. You can also add toolbar items to your code by callingsetToolbarItems:
+1
user4151918
source
to share