         super.layoutSubviews()
 
         updatePath()
-
         dummyView.frame.origin = frame.origin
     }
 


        let newPosition = layer.frame.origin

        let verticalDelta = abs(CGRectGetMinY(dummyView.frame) - newPosition.y)
        let horizontalDelta = abs(CGRectGetMinX(dummyView.frame) - newPosition.x)

        UIView.animateWithDuration(anim.duration,
            delay: anim.beginTime,
            usingSpringWithDamping: damping,

    override func addAnimation(anim: CAAnimation!, forKey key: String!) {
        super.addAnimation(anim, forKey: key)

        // Checks if the animation changes the position and lets the view know about that.
        if let basicAnimation = anim as? CABasicAnimation {
            if basicAnimation.keyPath == NSStringFromSelector("position") {
                self.delegate?.positionAnimationWillStart?(basicAnimation)
