 
 class ASFloatingHeadersFlowLayout: UICollectionViewFlowLayout {
     
-    var sectionHeadersAttributes:Array<UICollectionViewLayoutAttributes!> = []
+    var sectionAttributes:[(header:UICollectionViewLayoutAttributes!,footer:UICollectionViewLayoutAttributes!)] = []
     let offsets = NSMutableOrderedSet()
     var floatingSectionIndex:Int! = nil
     var previousWidth:CGFloat! = nil

            
            if let elementKind = attr.representedElementKind {
                if (elementKind == UICollectionElementKindSectionHeader){
                    return self.sectionHeadersAttributes[attr.indexPath.section]
                }
            }
            
            return attr
        }
        
        println("layoutAttributesForElementsInRect \(rect) ... OK")
        return ret
    }
    
    override func layoutAttributesForSupplementaryViewOfKind(elementKind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes! {
        
        println("2contentInset.top = \(self.collectionView!.contentInset.top)")

        if (elementKind == UICollectionElementKindSectionHeader){
            setOffsetOfFloatingHeader()
            return self.sectionHeadersAttributes[indexPath.section]
        }
        return super.layoutAttributesForSupplementaryViewOfKind(elementKind,atIndexPath:indexPath)
    }
    
    func indexForOffset(offset: CGFloat) -> Int {
        
        let range = NSRange(location:0, length:self.offsets.count)
        return self.offsets.indexOfObject(offset,

        return true
    }
    
    
    override func layoutAttributesForElementsInRect(rect: CGRect) -> [AnyObject]? {

      
        let attrs = super.layoutAttributesForElementsInRect(rect)
        let ret = attrs?.map() {
            
            (attribute) -> UICollectionViewLayoutAttributes in
