I am working on an iOS version of an Android application I wrote and I am having trouble figuring out the best way to display tabular data. Android has TableLayout and TableRow, making the task fairly simple.
The extra caveat is that however I create the data table, it needs to be created programmatically as there is an indeterminate # of tables to be displayed and each table has an indeterminate # of rows (all the information is pulled from a web service).
Also, if it helps, the app's orientation is portrait-only.
Here is an (ugly) example of how a table might look.
Any help would be awesome. Thanks!
Create a custom tableView Cell that has five labels.
class dynamicCell: UITableViewCell {
@IBOutlet var col1 : UILabel
@IBOutlet var col2 : UILabel
@IBOutlet var col3 : UILabel
@IBOutlet var col4 : UILabel
@IBOutlet var col5 : UILabel
init(style: UITableViewCellStyle, reuseIdentifier: String) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
override func awakeFromNib() {
super.awakeFromNib()
}
}
Don't forget to link the outlets to the storyboard too.