简体   繁体   中英

how to customize segment controller

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM