I\'m trying to make custom slider using
class MySlider: UISlider {
override func trackRect(forBounds bounds: CGRect) -> CGRect {
let customBounds
I was able to achieve this without subclassing:
Set Thumb Tint: Default
through IB
@IBOutlet weak var slider: MySlider!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let size = CGSize(width: 1 , height: 1)
UIGraphicsBeginImageContext(size)
let finalImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
slider.setThumbImage(finalImage, for: .normal)
}