Iglistkit: Allow subclassing of IGListCollectionView? Remove IGLK_SUBCLASSING_RESTRICTED?

Created on 21 Nov 2016  Â·  5Comments  Â·  Source: Instagram/IGListKit

In my project I have a CCTransparentTableView

It's a UITableView subclass that takes care to make the topMargin transparent to show what is behind.
I'm trying to substitute one of the CCTransparentTableView with a IGListCollectionView. The problem is that I'd like to reimplement the transparency logic in a CCTransparentCollectionView : IGListCollectionView and use it as IGListCollectionView. But IGLK_SUBCLASSING_RESTRICTED is blocking that.

Is IGLK_SUBCLASSING_RESTRICTED really necessary?

proposal

All 5 comments

Hey @lucabartoletti 😄

In general, we've taken pretty firm stances against subclassing in the Insta codebase, which is why this macro exists.

  1. Can you elaborate on what CCTransparentCollectionView does? Could this behavior be achieved without subclassing, (or by providing a custom UICollectionViewLayout)?
  2. I'll leave this open as a proposal. However, this is the first request we've gotten for this. If more people ask for this, we'll consider lifting the restrictions — but I don't think subclassing UICollectionView is very common.

Thanks for the reply @jessesquires

On the long term I plan to implement a custom UICollectionViewLayout to achieve the same effect.
My need for subclassing was due to the fact that I was substituting a UITableView subclass with a UICollectionView that uses IGListKit, I don't have time to spent on implementing a custom layout and the fastest thing was to adopt the same code that we have in the UITableView subclass on a UICollectionView subclass.

I understand your point about IGLK_SUBCLASSING_RESTRICTED and your internal policy against subclassing.

@lucabartoletti Feel free to also fork the project and remove the subclassing restriction if that's a requirement.

Got any examples of the design you're trying to achieve with this? We're happy to help guide custom layout stuff 😃

Going to close this for now, since we're passing on changing this at the moment.

Will re-open if there's more interest.

Note, we're discussing this again in #409

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jessesquires picture jessesquires  Â·  3Comments

shuhrat10 picture shuhrat10  Â·  3Comments

HarshilShah picture HarshilShah  Â·  3Comments

rnystrom picture rnystrom  Â·  3Comments

drinkius picture drinkius  Â·  3Comments