title: How delete row form UICollectionView?
body: <p>I have UICollectionView that has two UICollectionResuabeView(Custom View) and one UICollectionViewCell. The form a single entity in UICollectionView. I put Delete button on one of UICollectionResuabeView and by pressing it want to delete the row (if i call it right).
  This is the screenshot form Storyboard:
  <img src="https://i.stack.imgur.com/qmtiI.png" alt="enter image description here"></p>
  
  <p>I tried getting section of it my many means, but non works. Guess I just dont have enough knowledge of how UICollectionView works. Here is some code I tried:
  I know its I mess, but at least I was trying ))</p>
  
  <p>I ve tried this toget indexPath, but none works.
      -(IBAction)deletePressed:(UIButton* )sender{</p>
  
  <pre><code>    RecipeCollectionHeaderView *contentView = (RecipeCollectionHeaderView *)[sender superview];
      RecipeViewCell *cell = (RecipeViewCell *)[contentView superview];
      cell = (RecipeViewCell *)[contentView superview];
  
      // determine indexpath for a specific cell in a uicollectionview
      NSIndexPath *editPath = [self.collectionView indexPathForCell:cell];
      NSInteger rowIndex = editPath.row;
      NSInteger secIndex = editPath.section;
  //    NSIndexPath *indexPath = nil;
  //    indexPath = [self.collectionView indexPathForItemAtPoint:[self.collectionView convertPoint:sender.center fromView:sender.superview]];
  //    NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
  //    NSSet *touches = [event allTouches];
  //    
  //    UITouch *touch = [touches anyObject];
  //    
  //    CGPoint currentTouchPosition = [touch locationInView:self.collectionView];
  //    
  //    NSIndexPath *indexPath = [self.collectionView indexPathForItemAtPoint: currentTouchPosition];
      NSLog(@"IndexPath CollectionView %ld", (long)rowIndex);
  
  }
  </code></pre>
  
  <p>I also tried make it work like in this post, but it does not give a result:<a href="https://stackoverflow.com/questions/13875428/how-to-access-from-uicollectionviewcell-the-indexpath-of-the-cell-in-uicollectio?rq=1">how to access from UICollectionViewCell the indexPath of the Cell in UICollectionView</a>
  Thank you all!</p>
  
  <p><strong>EDIT!</strong>
  I found this works well:</p>
  
  <pre><code>-(IBAction)deletePressed:(UIButton* )sender{
      [self.ordersArray removeObjectAtIndex:0];
      [self.collectionView reloadData];
  }
  </code></pre>
  
  <p>The only thing I need now is to get section of UICollectionView by UIBotton that been pressed, to delete section I want. How to do it?)</p>
  
  <p><img src="https://i.stack.imgur.com/o6nF4.png" alt="enter image description here"></p>