Adding toolbar to UITableViewController using Swift

I want to add a toolbar at the bottom of the table. In this postoverflow post I learned that "if your UITableViewController is embedded in a UINavigationController, the navigation controller comes with a toolbar. You won't need to add your own." The author of this post goes to the objective-c list to make it visible. Can I refer to a tutorial or example that demonstrates quick code that will do the same thing? I am new to iOS and Xcode apps, learning them as I go.

+3


source to share


1 answer


To make the toolbar visible, just use this function in viewDidLoad:

self.navigationController!.setToolbarHidden(false, animated: true)

      

To fill items, you have the setToolbarItem function:



self.navigationController!.setToolbarItems(<toolbarItems: [AnyObject]?>, animated: <Bool>)

      

Here is a link to UINavigationController Class Reference

+5


source







All Articles