 
 import UIKit
 
-class MSTumblrMenuFlowLayout: UICollectionViewLayout {
+class MSTumblrMenuFlowLayout: UICollectionViewFlowLayout {
 
     var dynamicAnimator: UIDynamicAnimator!
     var collisionBehavior: UICollisionBehavior!

        }
        var attrs = UICollectionViewLayoutAttributes(forCellWithIndexPath: indexPath)
        attrs.size = self.cellSize
        attrs.center = CGPointMake(CGFloat(indexPath.row) * (cellSize.width + cellSpace) + cellSize.width / 2, CGFloat(indexPath.section) * (cellSize.height + cellSpace) + cellSize.height / 2)
        return attrs
//        return super.layoutAttributesForItemAtIndexPath(indexPath)
    }

        self.dynamicAnimator.delegate = self
        self.collisionBehavior = UICollisionBehavior()
        self.gravityBehaviour = UIGravityBehavior()
        self.gravityBehaviour.gravityDirection = CGVectorMake(0, -1)
        self.dynamicAnimator.addBehavior(self.collisionBehavior)
    }

    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.dynamicAnimator = UIDynamicAnimator(collectionViewLayout: self)
    }

    override func prepareLayout() {
        UIView.setAnimationsEnabled(false)
        super.prepareLayout()
    }

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