title: Update text in section header (UICollectionReusableView)
body: <p>How can I update <code>UICollectionView</code> section title? Headers (titles) for sections in my collection view show the total number of items available on each section and I need to update that title when the user has deleted items from the collection.</p>
  
  <p>I'm implementing datasource method <code>collectionView:viewForSupplementaryElementOfKind:atIndexPath:</code> to set a custom header for each one of the sections in my collection view, as follows:</p>
  
  <pre><code>- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
  
      UICollectionReusableView *view = nil;
  
      if([kind isEqualToString:UICollectionElementKindSectionHeader]) {
  
          view = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"myCustomCollectionHeader" forIndexPath:indexPath];
  
          MyCustomCollectionViewHeader *header = (MyCustomCollectionViewHeader *) view;
  
          NSString *headerTitle;
  
          if(indexPath.Section == 0) {
              headerTitle = [NSString stringWithFormat:@"%lu items", (unsigned long) myArrayOfObjectsInFirstSection.count];
          } else {
              headerTitle = [NSString stringWithFormat:@"%lu items", (unsigned long) myArrayOfObjectsInSecondSection.count];
          }
  
          header.myLabelTitle.text = headerTitle;
      }
      return view;
  }
  </code></pre>
  
  <p>My delete function is as follows:</p>
  
  <pre><code>- (void)deleteSelectedItems {
  
      NSArray *indexPaths = self.collectionView.indexPathsForSelectedItems;
  
      for(NSIndexPath *indexPath in indexPaths) {
  
          NSString *numberOfItems;
  
          if(indexPath.section == 0) {
              [myArrayOfObjectsInFirstSection removeObjectAtIndex:indexPath.row];
              numberOfItems = [NSString stringWithFormat:@"%lu items", (unsigned long)myArrayOfObjectsInFirstSection.count];
          } else {
              [myArrayOfObjectsInSecondSection removeObjectAtIndex:indexPath.row];
              numberOfItems = [NSString stringWithFormat:@"%lu items", (unsigned long)myArrayOfObjectsInSecondSection.count];
          }
  
          [self.collectionView deleteItemsAtIndexPaths:@[indexPath]];
      }
      /* after deleting all items, section title must be updated with the new value of numberOfItems*/
  }
  </code></pre>
  
  <p>My app is able to set the number of items in collection view when the app starts, but after deleting items from collection view the header doesn't get updated.</p>
  
  <p>Please advice</p>