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

Make compatible with IGListKit #6

Closed
otymartin opened this issue Apr 30, 2017 · 18 comments
Closed

Make compatible with IGListKit #6

otymartin opened this issue Apr 30, 2017 · 18 comments

Comments

@otymartin
Copy link

@roberthein
Hey how can I use this with IGListCollectionViewLayout?
Would appreciate some pointers.

I tried subclassing but i get errors

@alessandro-martin
Copy link

@otymartin IGListCollectionViewLayout is a subclass of UICollectionViewLayout while BouncyLayout is a subclass of UICollectionViewFlowLayout and they are quite different.
In fact @roberthein maybe on second thought BouncyFlowLayout would have been a slightly better name? :)

@otymartin
Copy link
Author

@alessandro-martin Thanks for the intel :)
@roberthein Any chance of extending support for IGListKist? It appears to be taking over this whole collectionView world.

@roberthein
Copy link
Owner

Hi @alessandro-martin and @otymartin!

I'm looking into this.

@LivioGama
Copy link

LivioGama commented May 13, 2017

I tried to make it work with IGListKit there are some problems : updating an object doesn't refresh its cell, nor change its bounds. It even create a strange gap later in the collectionView that is equal to what the clicked cell should have expanded in height.

On click, the cell should turn red and expand its height to 300px

simulator screen shot 13 mai 2017 a 21 19 01
simulator screen shot 13 mai 2017 a 21 19 17

Not sure if this is because of BouncyLayout or IGListKit, but it works with a normal UICollectionViewFlowLayout.
I'm going to talk about it here : Instagram/IGListKit#459

Please find attach the example I worked on :
BouncyLayout-master.zip

@LivioGama
Copy link

I progressed a bit, I found a way to do it but it's a bit dirty (see delegate method func didSelect(_ style: CellStyle) and it required that I change BouncyLayout class UIDynamicAnimator variable to open. This animator was the guilty one for caching old values and has to be empty manually before each addition/deletion/update of cells. Thanks to section Adding New Rows of https://www.objc.io/issues/5-ios7/collection-views-and-uidynamics/

New code :
BouncyLayout-master.zip

@otymartin
Copy link
Author

otymartin commented Jun 11, 2017

@LivioGama hey so I just tried this. it appears to work nicely except, I lost my grid view.
Previously I had a grid IGListCollectionView with 3 columns but with your BouncyLayout, it reduced to a single column just like your Photos Collection example.

How can I solve that?

Could you perhaps subclass ListCollectionViewLayout instead?

@otymartin
Copy link
Author

@LivioGama hey dont mean to nudge but still think you can hammer this out, would absolutley love to implement this in my production app🙏

@LivioGama
Copy link

It won't work because IGListKit layout is not a Flow layout like BouncyLayout. Maybe Instagram can make a FlowLayout, or maybe the author of BouncyLayout can make a subclass from IGListCollectionViewLayout to try to make that work. Meantime, I'm not expert enough with collection view layout to put my nose into it

@otymartin
Copy link
Author

@LivioGama thanks for trying, much appreciated.
@roberthein Would really appreciate support for IGListCollectionViewLayout

@heumn
Copy link

heumn commented Oct 1, 2017

When I was looking into this (another great UI component from @roberthein) I saw this issue and wonderd. Hm.. That is strange. IGListKit is still just data driven backing for UICollectionView and BouncyLayout is still just a modular layout for UICollectionView. Why would that not work together? Spoiler. It does :)

https://github.com/heumn/BouncyListKit

What have I done?
Forked IGListKid.
Added BouncyLayout
Opened EmptyViewController
💫 here comes the magic 💫
collectionView.collectionViewLayout = BouncyLayout()

Result:
Bouncy EmptyViewController demo project

Enough joking. If you guys could reproduce your problem in a fork of that project I will gladly help.

@LivioGama
Copy link

It work for simple cases, like a feed with one column. Try a grid of 2 columns.

@otymartin
Copy link
Author

@heumn Yes I have a grid with 3 columns. This layout turns it on into a single column grid.

@heumn
Copy link

heumn commented Oct 1, 2017

Thanks @LivioGama @otymartin. So I guess this is related to #14 ? I will look into it as well :) Works in my usecase (with IGListKit, but seems stranger things are happening with headers and different sections)

@heumn
Copy link

heumn commented Oct 1, 2017

Yeah, there are some caching issues here somewhere... I will dig more tomorrow when I have time :)

@otymartin
Copy link
Author

@heumn that would be wicked awesome if you could make it work with grid IGList layout :)

@heumn
Copy link

heumn commented Oct 6, 2017

@otymartin I have this thing called work on weekdays, but I will look into this on Saturday and Sunday :)

@otymartin
Copy link
Author

@heumn I can respect that. look forward to see what you pull off

@roberthein
Copy link
Owner

This should be fixed in 2.3.0.

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

No branches or pull requests

5 participants