Esri / data-collection-ios

Mobile data collection app using the iOS Runtime SDK.
https://developers.arcgis.com/
Apache License 2.0
25 stars 26 forks source link

Remove view controller logic from table cells #166

Closed esreli closed 4 years ago

esreli commented 5 years ago

From: https://github.com/Esri/data-collection-ios/pull/164#discussion_r258989108

Also, you might consider whether the cell really ought not to be updating its own content. Apple's documentation is pretty clear that the table view's data source is responsible to "always reset all content when reusing a cell". After all, the data source "mediates the application's data model for a UITableView object." It would make sense then that the data source would also be responsible to update a cell's content when it changes. In most cases the data source is the table view controller, so I think it would make sense to have RichPopupDetailsViewController update the cell's content. Right now there is no mediator. The cell (view) itself is interacting directly with the application's data.