MahmoudA
MahmoudA

Reputation: 137

Creating a multi column tableview/collectionview IOS

I need to create a multiple columned table which has independent scrolling for each view. Each column will contain sections that can be expanded to hold line items. All columns may not contain an equal number of sections. I was wondering what will be the best way to approach this. enter image description here

Upvotes: 2

Views: 589

Answers (2)

Jeffery Thomas
Jeffery Thomas

Reputation: 42598

I would recommend have each table view be contained in their own UITableViewController. Then you can use a container controller to display each table view controller in as subviews.

See: Creating Custom Container View Controllers


The advantage of this approach is that you can create a generic container view that only needs to worry about the location and sizing of the sub-view controllers. Each sub-view controller could worry about their own content. Thus you could have sub-view controllers be table view controllers, navigation view controllers or whatever you need at the time.

Upvotes: 3

fzwo
fzwo

Reputation: 9902

It sounds as though your columns won't really have anything to do with one another.

If so, just create three tableViews, and give each their own datasource and delegate.

Upvotes: 1

Related Questions