Statically I have mentioned the number of sections for the UICollectionView as 3 as shown in the below:
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
return 3;
}
Now I am trying to display the second section when the application launches instead of showing the first section.As UICollectionView is a subclass of UIScrollView. I wrote the code that:
[mCollectionView scrollRectToVisible:CGRectMake(0, 600, 320, 568) animated:YES];
but it was displaying the first section only.Is there any other way to display the second section in UICollectionView.
Try this
[collectionview scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1] atScrollPosition:UICollectionViewScrollPositionTop animated:YES];