     }
     
     func menuItemButtonTapped(button: UIButton) {
-        let menuItem = menuItems.filter {
-            $0.button == button
-            }.first
+        let menuItem = menuItems.filter { $0.button == button }.first
         if let menuItem = menuItem {
             delegate?.menuItemTapped(menuItem)
         }
     }
     
-}+}
+
+enum MenuItemAnimationDirection {
+    case In
+    case Out
+    
+    var damping: CGFloat {
+        switch self {
+        case .In:
+            return 1
+        case .Out:
+            return 0.8
+        }
+    }
+    
+    var velocity: CGFloat {
+        switch self {
+        case .In:
+            return 0.4
+        case .Out:
+            return 0.6
+        }
+    }
+    
+}
+

        }
        return menuItem.button as! T
    }

    public func removeMenuItem(position: MenuItemPosition) {
        if let index = indexOfMenuItemAtPosition(position) {
            let menuItem = menuItems[index]

public class DSRadialMenu: UIView {
    
    public typealias MenuItem = (button: UIButton, position: MenuItemPosition)
    
    @IBOutlet public weak var centerButton: UIButton!
    
    @IBInspectable public var menuItemSize = CGSize(width: 50, height: 50)
    @IBInspectable public var distanceFromCenter: Double = 100
    
    var distanceBetweenMenuItems: Double = 30
    
    public private(set) var menuItems = [MenuItem]()
    public private(set) var state: MenuState = .Closed
    public weak var delegate: DSRadialMenuDelegate?
    
    public enum MenuState {
