     // MARK: Private
 
     func updatePath() {
+        var frame: CGRect
+        if let presentationLayer = layer.presentationLayer() as? CALayer {
+            frame = presentationLayer.frame
+        } else {
+            frame = self.frame
+        }
+
+        let width = CGRectGetWidth(frame)
+        let height = CGRectGetHeight(frame)
+
+        let path = UIBezierPath()
+        path.moveToPoint(CGPoint(x: 0, y: 0))
+        path.addQuadCurveToPoint(CGPoint(x: width, y: 0),
+            controlPoint:CGPoint(x: width / 2.0, y: 0 + bendingOffset.vertical))
+        path.addQuadCurveToPoint(CGPoint(x: width, y: height),
+            controlPoint:CGPoint(x: width + bendingOffset.horizontal, y: height / 2.0))
+        path.addQuadCurveToPoint(CGPoint(x: 0, y: height),
+            controlPoint: CGPoint(x: width / 2.0, y: height + bendingOffset.vertical))
+        path.addQuadCurveToPoint(CGPoint(x: 0, y: 0),
+            controlPoint: CGPoint(x: bendingOffset.horizontal, y: height / 2.0))
+        path.closePath()
+
         shapeLayer.path = path.CGPath
+    }
+
+    func updateColor() {
+        shapeLayer.fillColor = fillColor.CGColor
     }
 
     func tick(displayLink: CADisplayLink) {
         let dummyViewPresentationLayer = dummyView.layer.presentationLayer() as CALayer
         let presentationLayer = layer.presentationLayer() as CALayer
 
-        bendingFactor = CGPoint(x: CGRectGetMinX(dummyViewPresentationLayer.frame) - CGRectGetMinX(presentationLayer.frame),
-            y: CGRectGetMinY(dummyViewPresentationLayer.frame) - CGRectGetMinY(presentationLayer.frame))
+        bendingOffset = UIOffset(horizontal: CGRectGetMinX(dummyViewPresentationLayer.frame) - CGRectGetMinX(presentationLayer.frame),
+            vertical: CGRectGetMinY(dummyViewPresentationLayer.frame) - CGRectGetMinY(presentationLayer.frame))
     }
 }

    }

    func commonInit() {
        shapeLayer.fillColor = fillColor.CGColor
        self.layer.insertSublayer(shapeLayer, atIndex: 0)
        updatePath()

        addSubview(dummyView)
    }


        let newPosition = layer.frame.origin

        // Effects of this animation are invisible, because dummyView is hidden.
        // dummyView frame's change animation matches the animation of the whole view, though it's in a different coordinate system.
        UIView.animateWithDuration(anim.duration,
            delay: anim.beginTime,
            usingSpringWithDamping: damping,
