SCheckbox是Swift编写的复选框控件。
class ViewController: UIViewController { @IBOutlet weak var check: SCheckBox! override func viewDidLoad() { super.viewDidLoad() self.check.color(UIColor.grayColor(), forState: UIControlState.Normal) self.check.textLabel.text = "this is a checkbox" self.check.addTarget(self, action: "tapCheck:", forControlEvents: UIControlEvents.ValueChanged) } func tapCheck(checkBox: SCheckBox!){ println("\(checkBox.checked)") }}点击空白处退出提示
评论