0

I am making an iPad application which requires the use of a "drill down" style set of table views for users to add elements to a list (i.e. a user taps on a table view cell and it brings up more detail or options, like you would see in settings). My problem is that I need to be able to place this table view inside of a view controller amongst other content. I can add a table view, but I need the navigation bar at the top of the view in order to mimic a tableView inside of a navigation controller.

Matt Spoon
  • 2,760
  • 5
  • 25
  • 41

1 Answers1

0

You need to use a UIViewController and

  • give it a tableView property
  • make it conform to the UITableViewDataSource protocol
  • make it conform to the UITableViewDelegate protocol

Navigation controller works exactly the same way regardless if you use a UITableViewController or UIViewController. Create storyboard segues and inform the detail view about the object to be displayed in prepareForSegue.

Mundi
  • 79,884
  • 17
  • 117
  • 140
  • Just one question, how can I position this table view controller on the screen? Also I have to do this programatically :( – Matt Spoon Oct 25 '15 at 11:02
  • You should use interface builder and connect the `tableView` to an `@IBOutlet`. Use auto-layout constraints to position the table view. - Do not do this in code. – Mundi Oct 25 '15 at 11:06