A simple demo that shows how to separate UITableViewDataSource and UICollectionViewDataSource from UIViewController. Source Code
snapshotsnapshot2
Steps:
  • Create DataSource class which implement UITableViewDataSource (Add UITaleViewDelegate if needed)
  • Create the ViewController in the storyboard, add one prototype cell
  • Create a CustomTableViewCell class, link the prototype cell to the class and further config the cell
  • Add the ViewController class, initialize the UITableViewDataSource and assign it to the TableView in the storyboard