Simplify boolean logic

This commit is contained in:
Levi McCallum
2016-03-24 21:40:49 -07:00
parent d845a18dfb
commit f51ca78570

View File

@@ -26,7 +26,7 @@
{
if (self.currentIndexPath) {
return [self _targetContentOffsetForItemAtIndexPath:self.currentIndexPath
proposedContentOffset:proposedContentOffset];
proposedContentOffset:proposedContentOffset];
}
return [super targetContentOffsetForProposedContentOffset:proposedContentOffset];
@@ -58,14 +58,7 @@
- (BOOL)_dataSourceIsEmpty
{
if ([self.collectionView numberOfSections]) {
if ([self.collectionView numberOfItemsInSection:0] == 0) {
return YES;
}
} else {
return YES;
}
return NO;
return ([self.collectionView numberOfSections] > 0 && [self.collectionView numberOfItemsInSection:0] > 0);
}
- (CGRect)_visibleRect