Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.41 KB

passing-data.md

File metadata and controls

32 lines (25 loc) · 1.41 KB

Passing Data

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.
}