Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Capability of applying different inset or item/line spacing to every section controller of IGListStackedSectionController. #448

Closed
2 tasks done
ShaneQi opened this issue Jan 26, 2017 · 4 comments

Comments

@ShaneQi
Copy link

ShaneQi commented Jan 26, 2017

New issue checklist

General information

  • IGListKit version: 2.1.0
  • iOS version(s): 10.2
  • CocoaPods/Carthage version: 1.1.1
  • Xcode version: 8.2
  • Devices/Simulators affected: both
  • Reproducible in the demo project?: Yes
  • Related issues: None

===============

Let's say I have a stackedSectionController managing three section controllers:

...
let stackedSectionController = IGListStackedSectionController(sectionControllers: [
	SectionControllerAAA(),
	SectionControllerBBB(),
	SectionControllerCCC(),
	])
...

If I want to only give inset and line spacing to SectionControllerAAA.
The problem is: setting inset and line spacing in SectionControllerAAA's initializer does't work. Because it is managed by stackedSectionController (I assumed all cells of all three sub section controllers are combined into a single section controller).

So I set inset and line spacing to the stackedSectionController:

...
stackedSectionController?.inset = UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5)
stackedSectionController?.minimumLineSpacing = 5
...

But another problem would be:
Setting inset and line spacing on stackedSectionController would effects all the three section controllers (and top/bottom inset doesn't apply between different sub section controllers) which is obviously not what I want in this case.

So I suggest to enhance IGListKit with the capability of applying different inset or item/line spacing to every section controller of IGListStackedSectionController.

I haven't got a chance look into it yet, so that I don't have the idea how complicated this enhancement would be. If this suggestion makes sense to you guys, I will go ahead try to do this.

@rnystrom
Copy link
Contributor

I love this idea, but I think that w/out a heavily customized UICollectionViewLayout that is designed specifically to integrate w/ IGListKit, it'll be almost impossible. UICollectionViewFlowLayout only applies insets to the entire section. The new layout we're introducing in #449 also uses that logic.

We could look into extending the new layout w/ this, but atm I think it's going to be too complicated.

IMO if the sections need to behave that differently, I wonder if they belong in the stack in the first place?

@ShaneQi mind if we close this?

@ShaneQi
Copy link
Author

ShaneQi commented Jan 28, 2017

@rnystrom
I looked into source code a little bit earlier today, seems too complicated, not worthy.
Also, my model is too complicated which makes layout complicated. I may need to simplify my model in the first place.

I agree we close this issue.
Thanks for the time!

@denisenkoaj
Copy link

denisenkoaj commented Mar 21, 2018

Hello guys, first of all - thanks for the great library!
I want to raise this issue again
Is there any way to make space between SectionControllers inside IGListStackedSectionController ?

@rnystrom
Copy link
Contributor

Unfortunately we're planning on deprecating IGListStackedSectionController (see #1099), but even if we weren't this would require a custom UICollectionViewLayout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants