I am trying to bind single UITableView
with 2 data sources.
My code is like this
viewModel?.dataSource?.currentYear?.bind(to: tableViewMonths, cellType: StatementExportMonthTableViewCell.self) { (cell, name) in
cell.updateWith(month: name)
}
viewModel?.dataSource?.previousYear?.bind(to: tableViewMonths, cellType: StatementExportMonthTableViewCell.self) { (cell, name) in
cell.updateWith(month: name)
}
I cant figure out how to show correct data into table view based on selected segment index. I know i can define one main data source and based on segment selection I should assign respective data source to that instance and reload tableview from that.
But I am trying to simplify it if Bond already has that functionality in-built.
Any help here would be much appreciated.
Thanks