Can you create a table with Swift that contains several columns?

1

I need to mount a multi-column table with customer purchase details, but with tableView I can only create tables with one column, how can I use the tableView or something else to create a multi-column table? Here's how I need to present the data:

    
asked by anonymous 16.11.2015 / 20:49

1 answer

3

You can user a UICollection, which has exactly this grid behavior (type excel) link

But apparently, in your case, a UITableView, with a prototype cell, is enough.

This is because the user does not need to click on a distinct field, it probably selects the entire "line."

Just drag to the prototype cell of your table the UILabels you need (one for password, another for rate, value, etc.).

It works as a template for table rows, so you can create a custom class that inherits from UITableViewCell (like @Jadson said in the comments) to link with @IBOutlet, or access via Tags.

Reference:
UICollectionView
UITableView

Prototype Cells Tutorial:
link

    
17.11.2015 / 12:51