///Button的创建及常用属性
///Button的创建
let button:UIButton = UIButton.init(type: UIButtonType.custom)
///创建Button的大小
button.frame = CGRect(x:20,y:100,width: 60,height:30)
///设置Button文字
button.setTitle("按钮", for: UIControlState.normal)
///设置Button文字颜色
button.setTitleColor(UIColor.red, for: UIControlState.normal)
///设置Button文字高亮
button.setTitle("高亮", for: UIControlState.highlighted)
///设置button文字选中状态
button.setTitle("选中", for: UIControlState.selected)
///设置button文字的背景颜色
button.backgroundColor = UIColor.purple
///设置button的背景图片
button.setBackgroundImage(UIImage(named:"ssss"), for: UIControlState.normal)
///添加按钮点击事件
button.addTarget(self, action: #selector(action(button:)), for: .touchUpInside)
self.view.addSubview(button)