Closed skydivedan closed 7 years ago
First of all, i would recommend trying to put all your data inside single UICollectionView
- you can try putting each deck in it's dedicated section. If this is possible in your setup, than it will greatly simplify all efforts.
Second, if that is not possible or easy to do in your case, you can definitely put a UICollectionView
inside of UITableViewCell
managed by DTTableViewManager
- this was actually the reason why DTTableViewManageable
protocol never implies that it is a view controller. However, in this case there are several things you need to worry about:
UICollectionView
- this needs to be done on freshly created cell, UICollectionView
needs to be added as a subview, and have appropriate autolayout constraints.DTTableViewManageable
instance, possibly inside configureCell
closure.DTCollectionViewManager
storage to avoid cases where UICollectionView
goes offscreen and still has items inside.UICollectionView
s inside a single UITableView
has been a bottleneck for me in the past - you will need to make sure that cells are super fast, otherwise on slow devices you will see slowdowns and lags. You will probably need to use Instruments and Time Profiler to make sure that everything is fast enough.Hope this helps you solving your task. I will close this issue as it's more a question than an issue, but you can ask more questions here if you have problems implementing this stuff.
Sorry, this is not a bug or issue, just looking for some guidance.
There's a really good post out there detailing how to put collection-views inside of UITableViewCells. https://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell-in-swift/
I'm trying to do something similar to this, but using DTTableViewManager (to populate UITableViewCells) and DTCollectionViewManager (for the UICollectionView that shows up inside each UITableViewCell)
My data model looks something like this:
Of course, the real data looks a little different. I'm using Realm for DTModelStorage, for example.
I'm just wondering if you've attempted anything like this using DTTableViewManager and DTCollectionViewManager, and might offer some advice on how best to proceed?
I'm working on a solution right now - but haven't cracked it yet. Any advice would be welcome.