Created
February 26, 2014 03:36
-
-
Save keicoder/9223093 to your computer and use it in GitHub Desktop.
objective-c : basic UICollectionView
This file contains hidden or 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
//basic UICollectionView | |
//TWPhotosCollectionViewController.h | |
@interface TWPhotosCollectionViewController : UICollectionViewController | |
@end | |
//TWPhotosCollectionViewController.m | |
@implementation TWPhotosCollectionViewController | |
#pragma mark - UICollectionView 데이터 소스 | |
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
if (debug==1) {NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));} | |
static NSString *CellIdentifier = @"Photo Cell"; | |
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier | |
forIndexPath:indexPath]; | |
cell.backgroundColor = [UIColor whiteColor]; | |
return cell; | |
} | |
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section | |
{ | |
if (debug==1) {NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));} | |
return 5; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment