0

I'm using this code from to customize my UISlider's thumbImage. It builds correctly in the storyboard but when I build and run it does not show my image? Could it be because I have it hooked up as an outlet as well? (necessary because I need to set the slider's value in code)

@IBDesignable
class DesignableSlider: UISlider {



    @IBInspectable var thumbImage: UIImage? {
        didSet{
              setThumbImage(thumbImage, for: .normal)
        }
    }


}
GarySabo
  • 5,806
  • 5
  • 49
  • 124
  • Works fine for me in a quick test - including having it hooked up to an `@IBOutlet`. Try it in a fresh project, and see if you get the same results. Since you say it's *"hooked up as an outlet"* are you possibly doing something in code that is changing it? – DonMag Mar 15 '19 at 17:34
  • You could try using `get` and `set` instead of `didSet`. – Guy Kogus Mar 15 '19 at 17:41
  • @DonMag not doing anything other than setting the slider's value. – GarySabo Mar 15 '19 at 18:09

0 Answers0