title: How can I remove the space between UICollectionViewCells?
body: <p>I was trying to remove the space between <code>UICollectionView</code> and this is the screenshots from device</p>
  
  <p><a href="https://i.stack.imgur.com/oZNRK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oZNRK.jpg" alt="enter image description here"></a></p>
  
  <p>I am really trying to avoid those spaces(blue color) and i have tried following codes</p>
  
  <p>This is my collectionview delegate</p>
  
  <pre><code>#pragma mark &lt;UICollectionViewDataSource&gt;
  
  - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
      return 1;
  }
  
  
  - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
      return 30;
  }
  
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
      cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
      cell.backgroundColor = [UIColor redColor];
      return cell;
  }
  </code></pre>
  
  <p>First I tried this one, and its not working</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
      UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc] init];
      flow.itemSize = CGSizeMake(cell.frame.size.width, cell.frame.size.height);
      flow.scrollDirection = UICollectionViewScrollPositionCenteredVertically;
      flow.minimumInteritemSpacing = 0;
      flow.minimumLineSpacing = 0;
      [self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"Cell"];
  
  }
  </code></pre>
  
  <p>and I tried this one also, its not working</p>
  
  <pre><code>#pragma mark collection view cell paddings
  - (UIEdgeInsets)collectionView:(UICollectionView*)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
      return UIEdgeInsetsMake(0, 0, 0, 0); // top, left, bottom, right
  }
  
  - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
  
      return 5.0;
  }
  </code></pre>
  
  <p>Please help me to fix this.</p>