ios - Multiple custom cell types per table UITableView (iPhone) -
ios - Multiple custom cell types per table UITableView (iPhone) -
i've been searching everywhere on apple.developer , stackflow , haven't come clear, standard , proper way of handling this. i'm looking how represent more 1 customized cell type in table. also, there other tables in app potentially reuse customized cells.
most of time, tables have same cell type repeated on , over. in few cases, have table couple types of complex custom cells.
listed below different ways i've learned can this. i've tried each 1 , work i'm unsure of "proper" way , way apple won't reject.
1) programatically - ultimately, best selection performance. if there's way can draw complex customized cells in interface builder, improve choice. i'm trying avoid.
2) a customized cell class separate xib - each customized cell has own header/implementation/xib , subclass of uitableviewcell. single cell in xib has file owner set specific uitableviewcontroller class. view here has been removed.
3) a customized cell in same xib view controller's xib - read bad. controller should associated single view in hierarchy. included customized cell in xib @ same level view , linked controller's iboutlet.
4) a separate mutual xib - dumping ground customized cells. view here has been removed. xib contains multiple cells , each cell associated specific subclass of uitableviewcell. header , implementation file contain definition , implementation each cell subclassed uitableviewcell. in controller showing table, method cellforrowatindexpath, loops through nsbundle mutual xib , finds cell associated specific subclass type of uitableviewcell. returns that. works beautifully reuse throughout app telling me it's bad.
what proper way different cell types in single table?
simply, if works go it. of these ideas viable solutions.
personally, i'd go them in order : 2, 1, 4, 3. though that's personal preference.
ps none of these ideas going app rejected apple.
iphone ios uitableview
Comments
Post a Comment