Created
November 13, 2014 17:15
-
-
Save miwillhite/2af64f27e26ee6b4f323 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In my init/setup | |
// Register the header | |
[self.collectionView registerClass:[DummyView class] | |
forSupplementaryViewOfKind:UICollectionElementKindSectionHeader | |
withReuseIdentifier:kJJUserJujuLibraryHeaderIdentifier]; | |
# This is being called | |
- (CGSize)collectionView:(UICollectionView *)collectionView | |
layout:(UICollectionViewLayout *)collectionViewLayout | |
referenceSizeForHeaderInSection:(NSInteger)section | |
{ | |
return CGSizeMake(CGRectGetWidth([UIScreen mainScreen].bounds), 56); | |
} | |
# This method is never called | |
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView | |
viewForSupplementaryElementOfKind:(NSString *)kind | |
atIndexPath:(NSIndexPath *)indexPath { | |
assert(false); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface DummyView : UICollectionReusableView | |
@end | |
@implementation DummyView | |
- (instancetype)initWithFrame:(CGRect)frame { | |
self = [super initWithFrame:frame]; | |
if(self) { | |
self.backgroundColor = [UIColor orangeColor]; | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment