Closed kleiberjp closed 7 years ago
I am not really sure what you mean. Maybe you could sketch out what you want? 🤔
@heumn i've update the issue description with more info, hope it help.
@kleiberjp I'm not totally sure what the problem is here. What are you expecting to happen?
To be fair, I haven't tried a setup like this. I'm sure its possible, but there might be some weird behavior.
One thing to note: the EmbeddedCollectionViewCell
shouldn't be the IGListAdapterDataSource
here. It should be the section controller that contains the horizontal list. Remember that cells will be reused, so that might mess something up.
@rnystrom ok what i expect is, that using the binding protocol on Embedded Cell
, and to make update to al the Binding Section, the cell horizontal doesn't make a reload again.
I mean, at example, if it's pressed the date number 17 (that is visible because i did scroll until that cell), when select the cell, bind the data for the another cells, and the horizontal cell keeps on same position, and updated the view for selected.
But it is not what happens here.
@kleiberjp any chance you could provide an example? That'd help me debug what's going on and better understand the intended behavior. This might just be a limitation of the framework, or we need to provide some guidance on setup.
@kleiberjp and updates on this? I am using IGListBindingSectionController is large projects and have zero issues most also contain setups with sideways scrolling embedded sections... Would love to help if you could provide me with an example project
I looked at the design you are trying to archieve and to me it looks a bit you are just using the Calendar example as a starting point and trying to cram the sideways scrolling cell into that one 🤔
I am not sure if ListBindingSectionController is really suitable for this particular usecase, because you are really operating at several different UICollectionViews with different scrollDirections.
What about splitting them up and skip the ListBindingSectionController?
Where the HoriztontalScrollingSectionController is the one who has a horizontal scrolling UICollectionView. It would need to have a delegate / block interface that tells someone (architeture depends on too many things... ) about the selection of a date.
Gonna close due to inactivity, but @heumn this is really awesome looking. Thank you for helping out here!!
For those wondering: I've managed to use ListBindingSectionController with embeddedSections, using the following viewModel:
final class SwipeItemsModel {
weak var adapter: ListAdapter?
weak var resource: Resource?
init(adapter: ListAdapter?, resource: Resource?) {
self.adapter = adapter
self.resource = resource
}
}
extension SwipeItemsModel: ListDiffable {
func diffIdentifier() -> NSObjectProtocol {
let updated = (resource?.updated ?? 0)
return updated as NSObjectProtocol
}
func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
if self === object { return true }
guard let object = object as? SwipeItemsModel else { return false }
return resource == object.resource
}
}
extension HorizontalStickySwipeCollectionViewCell: ListBindable {
func bindViewModel(_ viewModel: Any) {
guard let adapter = (viewModel as? SwipeItemsModel)?.adapter else { return }
adapter.collectionView = collectionView
}
}
All shows up as expected, got problems with updates for now, adapter.sectionController(for:)
returns nil, but in general setup works well and shows all the data
New issue checklist
README
and documentationGeneral information
IGListKit
version: 3.0.0Debug information
I see the awesome for the protocol IGListBindingSectionController, but i have tried hard to used in a cell that use embedded section controller for an horizontal scroll view, and the cell inside this one be the clickable for select and binding, but to make update it reload everything and doesn't work like the example of calendar
this is what i'm trying to do
instead the original that was vertical alignment, so in context this is what i've tried
the
EmbeddedCollectionViewCell.self
will work for horizontal items, and i pass the objects because doesn't find another way. So the cell will looks, something likeand on section controller where create the cell implement delegate for update data
but doesn't have the same behavior because the embedded section cell, before update always put on initial index, and don't stay on the selected index
if there are a way for make it, i appreciate it?