How to determine which cell is currently displayed on the screen in the middle?
Closed this issue · 2 comments
SadhuRus commented
How to determine which cell is currently displayed on the screen in the middle?
P.S: Thank you for good layout!! I use it in my project.
SadhuRus commented
Decided so (but that crutch):
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath {
... code ...
[self currentVisibleUser];
}
-(void)currentVisibleUser{
CGPoint center = CGPointMake(self.collectionView.bounds.origin.x+self.collectionView.center.x/2, self.collectionView.center.y/2);
NSIndexPath *path =[self.collectionView indexPathForItemAtPoint:center];
... my code ...
}