I have a weird problem with collectionView. I load collectionView in this way.
and those are the delegate methods
it displays only 15 cells and when i scroll down notihg is shown. What is wrong here ?
Code:
- (void)viewDidLoad {
[super viewDidLoad];
self.achievements = [self createAchievementsObjects];
[self.achievementsCollectionView reloadData];
}
Code:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
AchievementCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"achievementCell" forIndexPath:indexPath];
[cell setUpTheCellWithAchievement:self.achievements[indexPath.row]];
return cell;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.achievements.count;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
return 10;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
NSInteger width = (self.view.frame.size.width - 40 ) / 3;
return CGSizeMake(width, width);
}