I can change the font color of all the actions to be green like the picture above using the code below:
func showAlertSheet() {
let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
let accountAction = UIAlertAction(title: "Account", style: .default) { (action) in
self.performSegue(withIdentifier: "toAccountVC", sender: nil)
}
let actionPhotoLibrary = UIAlertAction(title: "Logout", style: .default) { (action) in
}
let actionCancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
actionSheet.addAction(accountAction)
actionSheet.addAction(actionPhotoLibrary)
actionSheet.addAction(actionCancel)
actionSheet.view.tintColor = UIColor(red: 0/255, green: 129/255, blue: 58/255, alpha: 1)
self.present(actionSheet, animated: true, completion: nil)
}
But I need to change Logout action to be red like the picture below
I have read this thread UIAlertController custom font, size, color but I can't find the way to change font color on particular UIAlertController action sheet.
What do I have to do?