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

Cannot inherit from non-open class 'CHTCollectionViewWaterfallLayout' outside of its defining module #193

Open
bizibizi opened this issue Aug 7, 2019 · 3 comments

Comments

@bizibizi
Copy link

bizibizi commented Aug 7, 2019

No description provided.

@ApolloZhu
Copy link
Contributor

Just changing access modifier from public to open would resolve the warning, but I'm not sure if that's the right thing to do. The current API design, in my point of view, is not suitable for subclassing; many implementations are kept private while several point of interest does not offer customization for subclasses.

So what's the problem you are trying to solve by inheriting from CHTCollectionViewWaterfallLayout?

@bizibizi
Copy link
Author

bizibizi commented Aug 12, 2019 via email

@ApolloZhu
Copy link
Contributor

Take a look at the project included in the Demo folder and see if you can implement this without subclassing the layout class?

let layout = CHTCollectionViewWaterfallLayout()
// Change individual layout attributes for the spacing between cells
layout.minimumColumnSpacing = 1.0
layout.minimumInteritemSpacing = 1.0
// Collection view attributes
collectionView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
collectionView.alwaysBounceVertical = true
// Add the waterfall layout to your collection view
collectionView.collectionViewLayout = layout

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

2 participants