Merge pull request #879 from levi/levi/custom-layout-example

Add custom collection view layout example project
This commit is contained in:
appleguy
2015-11-29 22:14:31 -08:00
51 changed files with 1485 additions and 3 deletions

View File

@@ -20,8 +20,8 @@
// FIXME: Temporary nonsense import until method names are finalized and exposed
#import "ASDisplayNode+Subclasses.h"
const static NSUInteger kASCollectionViewAnimationNone = UITableViewRowAnimationNone;
static const NSUInteger kASCollectionViewAnimationNone = UITableViewRowAnimationNone;
static const ASSizeRange kInvalidSizeRange = {CGSizeZero, CGSizeZero};
#pragma mark -
#pragma mark Proxying.
@@ -670,7 +670,17 @@ static BOOL _isInterceptedSelector(SEL sel)
- (ASSizeRange)dataController:(ASDataController *)dataController constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath
{
ASSizeRange constrainedSize;
ASSizeRange constrainedSize = kInvalidSizeRange;
if (_layoutInspector) {
constrainedSize = [_layoutInspector collectionView:self constrainedSizeForNodeAtIndexPath:indexPath];
}
if (!ASSizeRangeEqualToSizeRange(constrainedSize, kInvalidSizeRange)) {
return constrainedSize;
}
// TODO: Move this logic into the flow layout inspector. Create a simple inspector for non-flow layouts that don't
// implement a custom inspector.
if (_asyncDataSourceImplementsConstrainedSizeForNode) {
constrainedSize = [_asyncDataSource collectionView:self constrainedSizeForNodeAtIndexPath:indexPath];
} else {