Closed NinoScript closed 7 years ago
As discussed with @dzenbot via slack, the tableView
, collectionView
and scrollView
properties are just used to hold a strong reference and nothing more, so I can use - (instancetype)initWithScrollView:(UIScrollView *)scrollView
and keep my own reference to the collectionView or override the getter for collectionView
to return the one stored in scrollView
.
It's kind of a hacky solution, but it is a solution.
SlackTextController :heart: IGListKit
If it makes it any easier, we're probably going to remove the IGListCollectionView
requirement on IGListKit Instagram/IGListKit#409 soon.
Closing this for now, since @NinoScript found a workaround 💪
Description
I think it should be possible to inject our own UICollectionView instance, instead of just passing in a UICollectionViewLayout.
This makes it possible to use SlackTextViewController alongside other libraries like IGListKit
How to add this feature
In my case, I just added a new initializer:
- (instancetype)initWithCollectionView:(UICollectionView *)collectionView
that does the same as:
- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout
but instead of making it's own collection view like the existing initializer does:
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
it uses the one passed in:
_collectionView = collectionView;
and also it doesn't set the collectionView's delegate and dataSource.
I then injected in my IGListCollectionView instance, and voilà, both libraries seem to be working together perfectly. ;)