title: How to call UICollectionViewCell ImageView in IBAction Method?
body: <p>I'm struggling with something that might be easy but I can't get to it!</p>
  
  <p>I have a UIImageView inside a UICollectionViewCell and a Button Outside the UICollectionView. In my IBAction method of the button, how do I call this UIImageView?</p>
  
  <p>cell.ImageView is not permitted.</p>
  
  <p>EDITED CODE:</p>
  
  <pre><code>-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
  
  return 1;
  
  }
  
  -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
  
  return 10;
  
  }
  
  -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
  
  static NSString *cellIdentifier = @"Cell";
  VestimentaDetailCell *cell = (VestimentaDetailCell *) [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
  
  [cell.activityIndicator startAnimating];
  
  cell.imageFile.image = [UIImage imageNamed:@"LoadLook.png"];
  
  PFFile *imageFile = [self.vestimenta objectForKey:[NSString stringWithFormat:@"image_%ld", (long)indexPath.row]];
  
  [imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
  if (!error &amp;&amp; data.length &gt; 0) {
  
  cell.imageFile.image = [UIImage imageWithData:data];
  
      UITapGestureRecognizer *infoLook = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleTap:)];
  
      infoLook.numberOfTapsRequired = 1;
  
      [cell.imageFile addGestureRecognizer:infoLook];
  
  } else {
  
      [cell.progressView removeFromSuperview];
  
          }
  
  } progressBlock:^(int percentDone) {
      float percent = percentDone * 0.02;
      [cell.progressView setProgress:percent];
      if (percentDone == 100){
          [cell.progressView removeFromSuperview];
      };
  
      [cell.activityIndicator stopAnimating];
  }];
  
  return cell;
  }
  </code></pre>
  
  <p>Action Method:</p>
  
  <pre><code>-(void)handleTap:(UITapGestureRecognizer *) infoLook{
  
  if ([sender isSelected]) {
      [sender setImage:[UIImage imageNamed:@"Like.png"] forState:UIControlStateNormal];
      [sender setSelected:NO];
  } else {
      [sender setImage:[UIImage imageNamed:@"Liked.png"] forState:UIControlStateSelected];
      [sender setSelected:YES];
  UIImageView *like = [[UIImageView alloc] initWithFrame:CGRectMake(120, 220, 100, 100)];
  like.image = [UIImage imageNamed:@"Love.png"];
  [self.view addSubview:like];
  [UIView animateWithDuration:2 animations:^{like.alpha = 0.0;}];
  </code></pre>
  
  <p>This part is where I can't call the UIImageView of the UICollectionViewCell:</p>
  
  <pre><code>    NSData* data = UIImageJPEGRepresentation(cell.imageFile.image, 0.8f);
      PFFile *likedImage = [PFFile fileWithName:@"Image.jpg" data:data];
  
      [likedImage saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
          if (!error) {
              PFObject *userLikes = [PFObject objectWithClassName:@"UserProfile"];
              [userLikes setObject:likedImage forKey:@"likedLook"];
  
              userLikes.ACL = [PFACL ACLWithUser:[PFUser currentUser]];
  
              PFUser *user = [PFUser currentUser];
              [userLikes setObject:user forKey:@"user"];
  
              [userLikes saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
                  if (!error) {
                      NSLog(@"Saved");
                  } else {
                      NSLog(@"Error: %@%@", error, [error userInfo]);
                  }
              }];
          }
      }];
  
  NSLog(@"Liked Image");
  
  }
  
  }
  </code></pre>