                                                                                         -> (CGFloat, CGFloat) {
             // get attributes for first and last items in section
             guard let collectionView = collectionView  else { return (0, 0) }
-
             let section = sectionHeadersLayoutAttributes.indexPath.section
             
             // Trying to use layoutAttributesForItemAtIndexPath for empty section would

            let minY = attributesForFirstItemInSection.frame.minY - sectionFrame.height
            //   The section should not be lower than the bottom of its last cell
            let maxY = attributesForLastItemInSection.frame.maxY - sectionFrame.height
            
            return (minY, maxY)
    }
    
    private func firstSectionMetrics() -> (height: CGFloat, insets: UIEdgeInsets) {
        guard let collectionView = collectionView else { return (0, UIEdgeInsetsZero) }
        
        var firstSectionHeight = headerReferenceSize.height
        if let delegate = collectionView.delegate as? UICollectionViewDelegateFlowLayout
            where firstSectionHeight == 0 {
            firstSectionHeight = delegate.collectionView!(collectionView,
                                                          layout: self,
                                                          referenceSizeForHeaderInSection: 0).height

        // insets of the first section
        var theSectionInset = sectionInset
        if let delegate = collectionView.delegate as? UICollectionViewDelegateFlowLayout
                                                            where theSectionInset == UIEdgeInsetsZero {
            theSectionInset = delegate.collectionView!(collectionView,
                                                       layout: self,
                                                       insetForSectionAtIndex: 0)
        }
        return (firstSectionHeight, theSectionInset)
    }
}


