Merge pull request #598 from nguyenhuy/wrong_implementsInsetSection

Fix _implementsInsetSection of ASCollectionView being check before the asyncDelegate is set
This commit is contained in:
appleguy 2015-08-05 16:45:56 -07:00
commit 8da9ddd884

View File

@ -166,8 +166,6 @@ static BOOL _isInterceptedSelector(SEL sel)
_performingBatchUpdates = NO;
_batchUpdateBlocks = [NSMutableArray array];
_implementsInsetSection = ([_asyncDelegate respondsToSelector:@selector(collectionView:layout:insetForSectionAtIndex:)] ? 1 : 0);
[self registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"_ASCollectionViewCell"];
return self;
@ -244,10 +242,12 @@ static BOOL _isInterceptedSelector(SEL sel)
super.delegate = nil;
_asyncDelegate = nil;
_proxyDelegate = nil;
_implementsInsetSection = NO;
} else {
_asyncDelegate = asyncDelegate;
_proxyDelegate = [[_ASCollectionViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self];
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
_implementsInsetSection = ([_asyncDelegate respondsToSelector:@selector(collectionView:layout:insetForSectionAtIndex:)] ? 1 : 0);
}
}