     struct FrameAnimation: Equatable {
         /// Initializes the struct with all values set to zero / default.
         static let zero = FrameAnimation(frame: .zero,
-                                         duration: 0.0,
+                                         duration: 0,
                                          timingFunction: CAMediaTimingFunction(name: .default))
 
         /// The new rect for the frame.

        self.progress = progress
        shouldUpdateMaskLayerFrameOnProgressChange = true

        maskLayerFrameAnimationSubject.value = makeMaskLayerFrameAnimationForCurrentProgress(animated: animated)
    }

    // MARK: - Private methods

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


    /// The current bounds of the progress view.
    var bounds: CGRect = .zero {
        didSet {
            guard bounds != oldValue else {
                // Prevent unnecessary UI-updates.
                return
            }

            // Update mask-layer frame accordingly.
            maskLayerFrameAnimationSubject.value = maskLayerFrameAnimationForCurrentProgress(animated: false)
        }
    }

