Basically, I want to create a custom progressview that will have different colors depending on the progress value. It should look like the following:
[-----Red----][--Yellow--][-Green-]
Basically, I want to create a custom progressview that will have different colors depending on the progress value. It should look like the following:
[-----Red----][--Yellow--][-Green-]
Swift 5
My approach was this, hope this helps you. I piled 4 progres bars on top of each other and inside a stackView.
1) Create an image that has the desired color gradient in some image editing program.
2) Put the image into your asset library.
3) Generate a UIImage instance from the respective image.
4) Assign the UIImage instance to the
progressImage
property of UIProgressView.Or you can look at this library https://github.com/YannickL/YLProgressBar