     override func draw(_ rect: CGRect) {
         super.draw(rect)
 
-        guard let superview = superview else {
-            return
-        }
-
-        frame = superview.bounds
-
         let selectedTrackImage = drawImage(color: selectedTrackColor)
         let unselectedTrackImage = drawImage(color: unselectedTrackColor)
 

            return nil
        }

        drawLine(inContext: context, between: (startX, endX), color: color)
        drawCircles(inContext: context, between: (startX, endX), color: color)

        return UIGraphicsGetImageFromCurrentImageContext()?


    private func circleCenter(anchor: CGFloat, between: (startX: CGFloat, endX: CGFloat)) -> CGPoint {
        let pointX = anchor * frame.width
        let x = max(between.startX + anchorRadius, min(pointX, between.endX - anchorRadius))
        let y = frame.height / 2
        return CGPoint(x: x, y: y)
    }
