         fadeOutWorkItem?.cancel()
         fadeOutWorkItem = DispatchWorkItem() {
             [weak self] in
-            UIView.animate(withDuration: Constants.fadeOutAnimationDuration) {
+            guard let sSelf = self else { return }
+            UIView.animate(withDuration: sSelf.attributes.fadeOutAnimationDuration) {
                 views.forEach { $0?.alpha = 0.0 }
-                self?.isScrollBarActive = false
+                sSelf.isScrollBarActive = false
             }
         }
-        DispatchQueue.main.asyncAfter(deadline: .now() + Constants.fadeOutAnimationDelay,
+        DispatchQueue.main.asyncAfter(deadline: .now() + attributes.fadeOutAnimationDelay,
                                       execute: fadeOutWorkItem!)
     }
     

        guard let scrollBarView = scrollBarView,
            let scrollView = scrollView else { return }
        guard isScrollBarActive ||
            (speed >= Constants.minStartSpeedInPoints) else { return }
        isScrollBarActive = true
        scrollBarView.alpha = 1.0
        let rightOffset = dataSource?.rightOffset?(for: scrollBarView, for: self) ?? Constants.rightOffset
        let x = scrollView.bounds.maxX - scrollBarView.bounds.width - rightOffset
        let insets = scrollView.contentInset.top + scrollView.contentInset.bottom
        let scrollableHeight = scrollView.bounds.height - scrollBarView.bounds.height - insets

    @objc optional func textForHintView(_ hintView: UIView, at point: CGPoint, for scrollBar: ScrollBar) -> String
}

struct HintViewAttributes {
    var size: CGSize
    var cornerRadius: CGFloat
    var backgroundColor: UIColor
    var textColor: UIColor
    var font: UIFont
    
    init(size: CGSize = CGSize(width: 76, height: 32),
         cornerRadius: CGFloat = 5,
         backgroundColor: UIColor = UIColor.black.withAlphaComponent(0.3),
         textColor: UIColor = .black,
         font: UIFont = .systemFont(ofSize: 15)) {
        self.size = size
        self.cornerRadius = cornerRadius
        self.backgroundColor = backgroundColor
        self.textColor = textColor
        self.font = font
    }
}

struct ScrollBarAttributes {
    
    var minStartSpeedInPoints: CGFloat
    var rightOffset: CGFloat
    var fadeOutAnimationDuration: TimeInterval
    var fadeOutAnimationDelay: TimeInterval
    
    init(minStartSpeedInPoints: CGFloat = 20.0,
         rightOffset: CGFloat = 30.0,
         fadeOutAnimationDuration: TimeInterval = 0.3,
         fadeOutAnimationDelay: TimeInterval = 0.5) {
        self.minStartSpeedInPoints = minStartSpeedInPoints
        self.rightOffset = rightOffset
        self.fadeOutAnimationDuration = fadeOutAnimationDuration
        self.fadeOutAnimationDelay = fadeOutAnimationDelay
    }
}

class ScrollBar: NSObject {
    
    // MARK: - Public properties
    
