UIButton

Usage

var button = UIButton()
// 设置标签
button.setTitle("Press", forState: .Normal)
// 设置颜色
button.setTitleColor(UIColor.whiteColor(), forState: .Normal)
// 设置是否可用
button.enabled = true
// 设置背景颜色
button.backgroundColor = UIColor.red

// 设置按钮操作
button.addTarget(self, action: #selector(self.clickButton), forControlEvents: .TouchUpInside)