From 80916636eca9472ed1b3c3129cee07028f36ca5d Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Wed, 7 Dec 2016 10:07:45 -0800 Subject: [PATCH] =?UTF-8?q?Fix=20for=20issue=20#294=20-=20Support=20for=20?= =?UTF-8?q?UIAppearance=20in=20IGListCollectionView=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Source/IGListCollectionView.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/IGListCollectionView.m b/Source/IGListCollectionView.m index 6a0a3aa3..feace35a 100644 --- a/Source/IGListCollectionView.m +++ b/Source/IGListCollectionView.m @@ -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;