I'm facing a strange bug on a UICollectionView when compiling for iOS7 and it's working good on iOS8.
I have a UICollectionView inside an UICollectionViewCell, and when I select that UICollectionViewCell I'm increasing the size of that cell so the UICollectionView inside of it, should increase its size too.
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
if (collectionView == _collectionView){
NSLog(@"MainCell");
UICollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MenuCell" forIndexPath:indexPath];
UICollectionView * categoriesCollection = (UICollectionView*)[cell viewWithTag:2];
[categoriesCollection reloadData];
return cell;
}else{
NSLog(@"InsideCell");
UICollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"CategoryCell" forIndexPath:indexPath];
cell.backgroundColor = CUSTOMCOLOR_BLACKGROUND_CELL_CATEGORY;
UILabel * cellLabel = (UILabel*)[cell viewWithTag:11];
cellLabel.text = @"TEST";
return cell;
}
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
if (collectionView == _collectionView){
return 4;
}else{
return 12;
}
}
View on iOS8. https://www.dropbox.com/s/49xuy3ehhneuaki/Captura%20de%20pantalla%202014-10-02%2015.46.56.png
View on iOS7. It shows the correct space for 12 rows, but only 1 is shown. And the child collectionview height is 30, but should be 360. https://www.dropbox.com/s/oncfyc42v7zjpds/Captura%20de%20pantalla%202014-10-02%2015.49.16.png
When compiling for iOS8 with iOS8 SDK or iOS7 SDK, prints "InsideCell" 12 times as it should be, but when I'm using iOS8 SDK for iOS7, it only prints "InsideCell" 4 times, with row 0 always. Is this an Apple Bug? Thanks