         if animated {
             animationDuration = self.animationDuration
         } else {
-            animationDuration = 0.0
+            animationDuration = 0
         }
 
         return FrameAnimation(frame: maskLayerFrame,

    var progress: Float = 0.5 {
        didSet {
            // Make sure progress value fits our bounds.
            progress = min(1.0, max(0.0, progress))

            if shouldUpdateMaskLayerFrameOnProgressChange {
                maskLayerFrameAnimationSubject.value = makeMaskLayerFrameAnimationForCurrentProgress(animated: false)
            }
        }
    }

        self.progress = progress
        shouldUpdateMaskLayerFrameOnProgressChange = true

        maskLayerFrameAnimationSubject.value = maskLayerFrameAnimationForCurrentProgress(animated: animated)
    }

    // MARK: - Private methods

    private func maskLayerFrameAnimationForCurrentProgress(animated: Bool) -> FrameAnimation {
        var maskLayerFrame = bounds
        maskLayerFrame.size.width *= CGFloat(progress)

