Learn how to pass parsed data from your collection view
Within your ALCollectionView
instance, there's a property called array
. This represents the parsed array of models that populates your view.
For example, here's how you push the data of the cell the user has just tapped:
Objective-C
Swift
func collectionView(_ collectionView: UICollectionView, didSelectRowAt indexPath: IndexPath) {
let collection = collectionView as! ALCollectionView
let item = collection.array[indexPath.row]
// You're good to go.
}
- (void)collectionView:(UICollectionView *)collectionView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSDictionary *item = self.collectionView.array[indexPath.row];
// You're good to go.
}