CHTCollectionViewWaterfallLayout icon indicating copy to clipboard operation
CHTCollectionViewWaterfallLayout copied to clipboard

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

Open bizibizi opened this issue 4 years ago • 3 comments

bizibizi avatar Aug 07 '19 20:08 bizibizi

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?

ApolloZhu avatar Aug 12 '19 09:08 ApolloZhu

Problem which I solve is moving settings code to separate class and dublication it on several app screens

On 12 Aug 2019, at 17:21, ApolloZhu [email protected] wrote:

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?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

bizibizi avatar Aug 12 '19 09:08 bizibizi

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

https://github.com/chiahsien/CHTCollectionViewWaterfallLayout/blob/e4534860859ecf93c10a966f07f0ed8a14adf064/Demo/Swift/CHTWaterfallSwiftDemo/ViewController.swift#L44-L55

ApolloZhu avatar Aug 12 '19 10:08 ApolloZhu