Swift3 自定义我的AlertController swift 3.0

Swift3 自定义我的AlertController swift 3.0,swift3,uialertcontroller,Swift3,Uialertcontroller,我正在尝试更改“接受”按钮的颜色。这是我的密码 let alert = UIAlertController(title: "Aviso", message: "¿Desea eliminar el registro?", preferredStyle: .alert) //custome dialog // Restyle the buttons of the

我正在尝试更改“接受”按钮的颜色。这是我的密码

let alert = UIAlertController(title: "Aviso",
                                  message: "¿Desea eliminar el registro?",
                                  preferredStyle: .alert)
//custome dialog
// Restyle the buttons of the Alert
alert.view.tintColor = UIColor.black
alert.view.backgroundColor = UIColor.yellow


// Accept button
let submitAction = UIAlertAction(title: "Aceptar", style: .default, handler: { (action) -> Void in
    self.removePro()
})

    // Cancel button
let cancel = UIAlertAction(title: "Cancelar", style: .destructive, handler: { (action) -> Void in })

// Add action buttons and present the Alert
alert.addAction(cancel)
alert.addAction(submitAction)
present(alert, animated: true, completion: nil)
试试这个

submitAction.setValue(UIColor.blue, forKey: "titleTextColor")

我要做的是编写自己的呈现视图控制器,其视图看起来像警报控制器的视图。这样,我可以做任何我喜欢的定制。