一、概述
二、属性
@property(nullable, nonatomic, strong) UIColor *onTintColor;
2. 设置开关闭是时的边框颜色,当开关开启时,颜色全部变为开启时设置的颜色
@property(null_resettable, nonatomic, strong) UIColor *tintColor;
3. 设置开关的按钮颜色
@property(nullable, nonatomic, strong) UIColor *thumbTintColor;
4. 设置开关的开启状态;YES 为开启,NO 为关闭
@property(nonatomic,getter=isOn) BOOL on;
5. 设置开关的开启状态并设置动画效果
- (void)setOn:(BOOL)on animated:(BOOL)animated;
6. 设置开关的开启图片;在 iOS 7 中没有用
@property(nullable, nonatomic, strong) UIImage *onImage;
7. 设置开关的关闭图片;在 iOS 7 中没有用
@property(nullable, nonatomic, strong) UIImage *offImage;