I'm a new iOS developer.
Recently I'm learning UICollectionView and I'm trying to subclass the UICollectionViewLayout.
I have to implement the method
-(NSArray*)layoutAttributesForElementsInRect:(CGRect)rect
Question
I have no idea where did this rect come from? and in which scenario will this rect be passed to me ?
PS. I think this method might be more easy to understand
- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)path
Because the indexPath is limited and finite and configure the cell in the particular indexPath is reasonable.
But the rect might be infinite and I have no idea where this rect came from.