title: Image fits into UICollectionView Cell
body: <p>I am using <code>collectionview</code> to display the products where I fetched from the server. However images does not fit into the <code>collectionview</code> cell. I wonder is there a way of fixing it?</p>
  
  <pre><code>NSURL *url = [NSURL URLWithString:@"http://www.myURL/productAll.php"];
  NSURLRequest *request = [NSURLRequest requestWithURL:url];
  [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
      NSError *myError = nil;
      id res = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&amp;myError];        
      items = [[NSMutableArray alloc] init];
      for (int i=0; i&lt;[res count]; i++) {
          NSString *arrayResult = [[res objectAtIndex:i]objectForKey:@"image"];            
          NSData *data = [[NSData alloc] initWithBase64EncodedString:arrayResult options:NSDataBase64DecodingIgnoreUnknownCharacters];
          UIImage *captcha_image = [[UIImage alloc] initWithData:data];
          [items addObject:captcha_image];
      }
      [collectionView reloadData];
  }];
  </code></pre>
  
  <p>Here is the <code>collectionView</code> cell design, <code>imageView</code> dimension matches with <code>collectionView</code> cell.
  <a href="https://i.stack.imgur.com/grCYP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/grCYP.png" alt="enter image description here"></a></p>
  
  <p>Here is what user sees:</p>
  
  <p><a href="https://i.stack.imgur.com/jncMN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jncMN.png" alt="enter image description here"></a></p>
  
  <p>Here are the extra information from ImageView</p>
  
  <p><a href="https://i.stack.imgur.com/9qqvQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9qqvQ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/S5KWE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S5KWE.png" alt="enter image description here"></a></p>
  
  <p>cellCollectionView</p>
  
  <p><a href="https://i.stack.imgur.com/bvDKS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bvDKS.png" alt="enter image description here"></a></p>