I need the following slider control.
- There is a total length (corresponds to a total duration in seconds)
- Unlike
UISliderthere is a range within the total length that is “accessible” with the slider - The slider has a position on that “accessible” track and does not go beyond it.
I currently see the following approaches, which both seem to have their pros and cons:
- Create a
UISlidersubclass and add new properties and functionality to it - I create a custom control with a
UIViewwhich contains a UISlider and aUIProgressBarand provide an API similar to the one ofUISlider. - I create the control from scratch with custom drawing code.
I am not sure if there are some aspects that I have missed. I am now wondering which approach is the most suitable for my problem.
Below are the few links which shows how you can create a custom slider :
Note: Normally for creating any UI custom control you can simply inherit the class from UIControl class which will allow you to have all the properties of the class that you want and other properties also… but be careful of using it….