CTCheckbox是iOS 5+上的勾选框UI组件库,
您在Storyboard上将UIView更改为CTCheckbox类,并设置为其UIViewController。
@property (weak, nonatomic) IBOutlet CTCheckbox *checkbox;
[self.checkbox addTarget:self action:@selector(checkboxDidChange:) forControlEvents:UIControlEventValueChanged];
self.checkbox.textLabel.text = @"Label text";
- (void)checkboxDidChange:(CTCheckbox *)checkbox
{
NSLog(@"%d", checkbox.checked);
}
或使用initWithFrame:
创建。
CTCheckbox可在MIT许可证下使用。有关更多信息,请参阅LICENSE文件。