Question

iOS Simulator Screen shot Jun 19, 2013 2.43.43 PM.png!Main Storyboard description

Was it helpful?

Solution

This is really simple. In your collection view datasource methods, make sure you distinguish between the two views by keeping strong references to the views e.g. as properties:

if (collectionView == _topCollectionView) {
   // provide the data for the top view
}
else {
   // provide the data for the bottom view
}

Do the same in didSelectItemAtIndexPath. Determine which collection view has been interacted with, change the appropriate data in for the other one and reload and/or update your image view.

You need to use a standard view controller and add the delegate and datasource declarations manually.

@interface ViewController : UIViewController 
         <UICollectionViewDataSource, UICollectionViewDelegate>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top