iOS Snippets / Swift

Customizing UISlider design

iOS Snippets / Swift

Sometimes you might decide to modify your UISlider a bit. Let’s say you want to have the red thumb. You can set ‘thumbTintColor’ to .redColor(), but this will change even color of the shadow. Or you can create an image asset and assign it using ‘setThumbImage’ function. But if you later decide to change the thumb size or the thumb color again, you will have to create new image asset.

Or you can use UIKit and render this image from a custom UIView. Here is how you can do it:

 

Categories: iOS Snippets, Swift
Read more:

Post a new comment