by wastedbrains on 12/2/13, 8:50 PM with 15 comments
by bengotow on 12/2/13, 11:22 PM
This is a great exercise, but please, please don't use your hand-rolled UITableView in your apps.
If UITableView doesn't do what you need, create a UICollectionView. If you find the data source protocol frustrating to use, create a provider object that maps your (array/dictionary/weird-ass data structure) onto the dataSource protocol. (In desktop Mac programming, NSArrayControllers serve this purpose.) Don't re-implement UITableView. The things you could potentially screw up are many, and when some other developer inherits your code and tries to add editing, multiple selection, re-ordering, etc..., they're going to be pissed.
by prewett on 12/3/13, 2:23 AM
Although, my view of MVC is that the model is just the data (pretty lightweight), the view just draws the things, and the controller handles user actions. So you could remove the view and do testing on the controller. This doesn't seem to be Apple's perspective, so maybe I just haven't figured out their perspective yet.
by brendanlim on 12/2/13, 9:10 PM
by kurtle on 12/2/13, 9:05 PM
Nothing unusual about delegates, the entire iOS codebase is littered with them.
But kudos on doing what we all eventually think about doing, the longer we work with UITableView
by yesimahuman on 12/2/13, 10:44 PM
by perishabledave on 12/2/13, 9:35 PM