定义UIAlertController
let myAlert = UIAlertController(title:"", message: "确认要..吗?", preferredStyle: UIAlertControllerStyle.alert)
let cancleAction = UIAlertAction(title: "取消", style: .cancel, handler: nil)
let okAction = UIAlertAction(title: "确认", style: .default) { (aaa) in
确认方法 func
}
弹出UIAlertController
myAlert.addAction(okAction)
myAlert.addAction(cancleAction)
self.present(myAlert, animated: true, completion: nil)
修改UIAlertController字体颜色
okAction.setValue(UIColor.colorWithHex(hexValue: 0x282828), forKey: "titleTextColor")