Edit:
I forgot to mention that I made an extension for UIColor:
extension UIColor {
func circle(_ size: CGSize = CGSize(width: 1, height: 1)) -> UIImage {
return UIGraphicsImageRenderer(size: size).image { rendererContext in
self.setFill()
UIBezierPath(ovalIn: CGRect(origin: .zero, size: size)).fill()
// rendererContext.fill(CGRect(origin: .zero, size: size))
}
}
}
And the thumb is supposed to follow your touch location and grow and shrink depending on the value. Additionally, if the thumb goes past the end of the slider, translation is supposed to essentially "move" the slider so it's as if the entire slider was dragged to where you moved the thumb.