Overview of the IOS system switch control simple use:
Initialization
-(Instancetype) initWithFrame: (CGRect) frame;
This frame is meaningless, and the size of the system's switch control is deterministic.
To set the color of the switch when the state is turned on
@property (nonatomic, retain) Uicolor *ontintcolor;
Set Switch style color
@property (nonatomic, retain) Uicolor *tintcolor;
Set the switch button color
@property (nonatomic, retain) Uicolor *thumbtintcolor;
Set the picture when the switch is on (note: no longer works after IOS7)
@property (nonatomic, retain) UIImage *onimage;
Set the picture when the switch is off (note: No longer works after IOS7)
@property (nonatomic, retain) UIImage *offimage;
Status of the switch
@property (Nonatomic,getter=ison) BOOL on;
Manually set the switch status
-(void) SetOn: (BOOL) on animated: (BOOL) animated;
A little bit of a feeling: The iOS system's Uiswitch control, although very poor in customization, with the IOS7 of the flat and frugal style, in beauty is really not inferior to any private custom switch control, in the absence of special needs, for switching logic, this is a very good UI interaction choice.
Learn to use welcome reprint
IOS Uiswitch Usage Summary