I am trying to achieve this kind of slider to draw a line around the thumb in swift an uikit.this is what I am trying to achieve. Anyone can guide how can I achieve this or any cocoapods I can use.
This is what I have achieved so far
This is my code I have written to draw the curve.
private func drawCurvedLine() {
guard let context = UIGraphicsGetCurrentContext() else { return }
let trackRect = self.trackRect(forBounds: bounds)
let thumbRect = self.thumbRect(forBounds: bounds, trackRect: trackRect, value: value)
let startX = trackRect.minX - 5
let endX = trackRect.maxX + 5
let thumbCenterX = thumbRect.midX
let thumbCenterY = thumbRect.minY + 10 // Start of the thumb
let curveHeight: CGFloat = 20
let radius: CGFloat = 20 // Radius for the curve around the thumb
context.setStrokeColor(UIColor.black.cgColor)
context.setLineWidth(1.5)
//context.setLineCap(.round)
// Line before the curve
context.move(to: CGPoint(x: startX, y: thumbCenterY))
context.addLine(to: CGPoint(x: thumbCenterX - radius - 5, y: thumbCenterY))
// Curved line above the thumb
context.addCurve(to: CGPoint(x: thumbCenterX + radius + 5, y: thumbCenterY),
control1: CGPoint(x: thumbCenterX - radius, y: thumbCenterY - curveHeight),
control2: CGPoint(x: thumbCenterX + radius, y: thumbCenterY - curveHeight))
// Line after the curve
context.addLine(to: CGPoint(x: endX, y: thumbCenterY))
context.strokePath()
}