I tried to:
- (IBAction)delete:(UIButton*)sender{
NSIndexPath *indexPath = [self.collectionView indexPathForCell:(TourGridCell *)[[[sender superview]superview]superview]];
}
But NSLog shows that cell exist, but indexpath is nil.
OK, here it is:
- (IBAction)delete:(UIButton *)sender{
NSIndexPath *indexPath = nil;
indexPath = [self.collectionView indexPathForItemAtPoint:[self.collectionView convertPoint:sender.center fromView:sender.superview]];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With