       lastCells.keyEnumerator().forEach { obj in
         //      for obj in lastCells.keyEnumerator() {
         if let indexPath = obj.indexPath {
-          let indexPAthKey = indexPath.section
+          let indexPAthKey = (indexPath as NSIndexPath).section
           
           var header = headers[indexPAthKey]
           if header == nil {
-            header = self.layoutAttributesForSupplementaryViewOfKind(UICollectionElementKindSectionHeader, atIndexPath: NSIndexPath(forItem: 0, inSection: indexPath.section))
+            header = self.layoutAttributesForSupplementaryView(ofKind: UICollectionElementKindSectionHeader, at: IndexPath(item: 0, section: (indexPath as NSIndexPath).section))
             if let header:UICollectionViewLayoutAttributes = header as? UICollectionViewLayoutAttributes {
               allItems.append(header)
             }

    
    origin.y = maxY
    
    attributes.frame = CGRect(origin: CGPoint(x: origin.x, y: origin.y), size: CGSize(width: attributes.frame.size.width, height: attributes.frame.size.width))
  }
}

    return attributes
  }
  
  public override func layoutAttributesForSupplementaryView(ofKind elementKind: String, at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
    var attributes = super.layoutAttributesForSupplementaryView(ofKind: elementKind, at: indexPath)
    if attributes != nil && elementKind == IOStickyHeaderParallaxHeader {
      attributes = IOStickyHeaderFlowLayoutAttributes(forSupplementaryViewOfKind: elementKind, with: indexPath)
    }
    
    return attributes
  }
  
  public override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
    var adjustedRec = rect
    adjustedRec.origin.y -= (self.parallaxHeaderReferenceSize?.height)!
    
    let attributes = super.layoutAttributesForElements(in: adjustedRec)
    var allItems = [UICollectionViewLayoutAttributes]()
    
    attributes?.forEach { itemAttributes in
