ios 自定义UISwitch 效果图如下:
1.定义两个UILable和一个UISwitch
@property (strong, nonatomic) UISwitch *costom;
@property (strong, nonatomic) UILabel *label;
@property (strong, nonatomic) UILabel *offLabel;
self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 30, 31)];
self.label.textAlignment = NSTextAlignmentCenter;
[self.label setFont