Reputation: 6109
First of all, pardon me if my question is inappropriate. I went thru some tutorials to customize the uisegment controller in ios. What they do is they create a subclass either of UISegmentedControl
or UIControl
My question is
what is the purpose behind the scene when you do a subclass of UISegmentControl or UIControl
Upvotes: 0
Views: 258
Reputation: 318774
The purpose of subclassing UISegmentedControl or UIControl is the same purpose as subclassing any other class - because you wish to extend or alter the behavior of the base class. UIControl is kind of like UIViewController. You never create instances of UIViewController. You always create subclasses to make specific view controllers for your app. UIControl is similar. It gives you basic UI control functionality but not for any specific control. You would subclass UIControl to create your own, unique UI control that isn't provided by the SDK.
Upvotes: 1