title: How to create button action on cell click in a collection view
body: <p>Actually I have taken a two collection view controllers. In first collection view controller iIhave passed array of images.on the click of the one image ,i want to display another collection view controller.how to do this...please suggest me .</p>
  
  <pre><code>- (void)viewDidLoad
  {
  [super viewDidLoad];
  
  recipeImages = [NSArray arrayWithObjects:@"angry_birds_cake.jpg", @"creme_brelee.jpg", @"egg_benedict.jpg", @"full_breakfast.jpg", @"green_tea.jpg", @"ham_and_cheese_panini.jpg", @"ham_and_egg_sandwich.jpg", @"hamburger.jpg", @"instant_noodle_with_egg.jpg", nil];
  }
  
  - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
  return recipeImages.count;
  }
  
  - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
  
  }
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
  static NSString *identifier = @"Cell";
  
  UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
  
  UIImageView *recipeImageView = (UIImageView *)[cell viewWithTag:100];
  recipeImageView.image = [UIImage imageNamed:[recipeImages objectAtIndex:indexPath.row]];
  cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"photo-frame.png"]];
  for (UIView *view in cell.subviews) {
      if ([view isKindOfClass:[UILabel class]]) {
          [view removeFromSuperview];
      }
  }
  
  
  UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 150, 170)];//Set the frame as per your requirement.
  label.font=[UIFont systemFontOfSize:10];
  
  [label setText:[NSString stringWithFormat:@"%@",[categoryArray objectAtIndex:indexPath.row]]];
  [cell addSubview:label];
  //NSLog(@"hiiiii");
  
  
  return cell;
  </code></pre>
  
  <p>}</p>