Ace
Ace

Reputation: 613

Difference between table view controller and a table view placed within a viewcontroller

I am making an app and would like to direct my user once they log in into their dashboard, I have seen some apps display things in what seem like a table view controller or a view controller with a table view. I would like to display the logo up top and then a table displaying their username then about 4 more rows displaying other info then at the bottom a tab bar. What would be the best way to go about this?

any advice welcomed. If relevant I am using swift, Xcode7 and parse to handle my users

Upvotes: 2

Views: 2875

Answers (2)

truongky
truongky

Reputation: 1147

Some differences between UITableViewController (TV) and UIViewController with TableView (VT) I know:

  • You can add other controls into VT and pin it to anywhere you want. TV can't do that.
  • You can add many same group of controls without add constraints with TV. VT you have to add constraints.
  • You don't want to worry about scrolling in TV with many group of controls.
  • With TV you can create static table cell but you can't with VT. Static table works on TableViewController only.

In your situation, I use UITableViewController with static table to achieve that.

Hope this can help.

Upvotes: 1

user3857868
user3857868

Reputation:

Use a UITableView. This a bit more customizable in terms of Storyboard layout. You can place UIImageViews, toolbars, and other elements all over your UIViewController. You can then put a UITableView in the exact place that would work for you, with the dimensions you need.

Of course, you could always use a UITableViewController. You could embed this controller in a variety of combinations, which would let you add tab bars or navigation bars.

The only real difference in implementation is that you have to remember to explicitly write the delegate and data source methods when using a UITableView.

For your case, I would pick whatever seems easiest to implement in your case. Probably a UITableView in my opinion.

Upvotes: 1

Related Questions