Fix for issue #294 - Support for UIAppearance in IGListCollectionView…

Summary:
Updated IGListCollectionView:initWithFrame:collectionViewLayout constructor to support UIAppearance for the backgroundColor property.

Fixes #294

- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/298

Differential Revision: D4292394

Pulled By: rnystrom

fbshipit-source-id: a7c4f0e516728b684993f2651eadcc25001de783
This commit is contained in:
Jeff Bailey 2016-12-07 10:07:45 -08:00 committed by Facebook Github Bot
parent 4c4fdec562
commit 80916636ec

View file

@ -13,7 +13,12 @@
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout {
if (self = [super initWithFrame:frame collectionViewLayout:layout]) {
self.backgroundColor = [UIColor whiteColor];
UIColor *backgroundAppearanceColor = (UIColor *) [[[self class] appearance] backgroundColor];
if (!backgroundAppearanceColor) {
self.backgroundColor = [UIColor whiteColor];
}
self.alwaysBounceVertical = YES;
}
return self;