title: Multiple UICollectionView in one view update second UICollectionView data
body: <p>I want to design as like image. I use two UICollectionView to design. But I can't update second UICollectionView data after click fast on UICollectionview row. I never think this is the correct way to do this. Any suggestion please. I need to do with Objective-C.</p>
  
  <p><a href="https://i.stack.imgur.com/Dpapk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dpapk.png" alt="enter image description here"></a></p>
  
  <p>My Code:</p>
  
  <pre><code>- (NSInteger)collectionView:(UICollectionView *)view numberOfItemsInSection:(NSInteger)section
  {
      if (view.tag == 1) {
          return 20;//SelfiThemeIm;age.count
      } else {
          return 15;
      }
  }
  
  - (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
      if (cv.tag == 0) {
          TopCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"TopCell" forIndexPath:indexPath];
          NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: SelfiThemeImage[indexPath.row]]];
          cell.imageView.image  = [UIImage imageWithData: imageData];
  
          return cell;
      } else {
          BottomCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"BottomCell" forIndexPath:indexPath];
  
          NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: SelfiThemePhysicalFileName[indexPath.row]]];
          cell.imageView.image  = [UIImage imageWithData: imageData];
  
          return cell;
      }
  }
  
  - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      NSString *ThemeURL;
  
      if (collectionView.tag == 1) {
          ThemeURL = @"http://wap.shabox.mobi/sticker_app_server/content.aspx?catid=";
          ThemeURL =[ThemeURL stringByAppendingString:[SelfiThemeImageContentCode objectAtIndex:indexPath.row]];
  
          BottomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"BottomCell" forIndexPath:indexPath];
          AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
          [manager GET:ThemeURL
            parameters:nil
               success:^(AFHTTPRequestOperation *operation, id responseObject) {
                   NSString *array= [responseObject objectForKey:@"stickers"];
  
                   self.selfidata = array;
  
                   // NSLog(@"JSON responce Selfi: %@",     self.selfidata);
  
                   for(int i=0; i&lt;=self.selfidata.count-1; i++){
                       NSString *PhysicalFileName = @"http://wap.shabox.mobi/CMS/content/graphics/Stickers/D200x200/";
                       PhysicalFileName =[PhysicalFileName stringByAppendingString:[[self.selfidata objectAtIndex:i]objectForKey:@"PhysicalFileName"]];
                       PhysicalFileName =[PhysicalFileName stringByAppendingString:@".png"];
  
                       [SelfiThemePhysicalFileName addObject:[NSString stringWithFormat:PhysicalFileName]];
                       NSLog(@"PhysicalFileName Array - %@", PhysicalFileName);
                   }
  
                   NSLog(@"SelfiThemePhysicalFileName Array - %@", SelfiThemePhysicalFileName);
  
                   NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: SelfiThemePhysicalFileName[indexPath.row]]];
                   cell.imageView.image  = [UIImage imageWithData: imageData];
               } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
                   NSLog(@"Error: %@", error);
               }];
      }else{
      }
  }
  </code></pre>