Tagged with uitableviewBrowse all tags
Diffable Data Source API helps us to manage data sources both in TableView and CollectionView by using snapshot. Snapshot acts as a source of truth between our view and data source, whenever there are changes in our model, we just need to construct a new snapshot and applies it to the current snapshot.
TableView Controller is an essential UIKit component that is almost used in every iOS app out there to present collection of data in list. When we have different type of data that we want to display in the UITableViewController, most of the time we create a new subclass to display the related type of data. This approach works, but can lead to repetition and difficulty in maintenance if we have many different types of data in our application.
UITableView and UICollectionView are two of the main user interface elements that drives an iOS app when presenting list of data. In this article, we are going to avoid massive view controller code by encapsulating the UITableViewDataSource and UITableViewDelegate into separate DataSourceProvider Class.