In swift, I am trying to add different colors to different buttons in a single option sheet. This is a sample:
let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
let reccommendAction = UIAlertAction(title: "Reccommend", style: .default, handler: {
(alert: UIAlertAction!) -> Void in
print("Recommended")
})
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: {
(alert: UIAlertAction!) -> Void in
print("Cancelled")
})
optionMenu.addAction(reccommendAction)
optionMenu.addAction(cancelAction)
currentVC?.present(optionMenu, animated: true, completion: nil)
The task I wish to complete is to make the Recommend
button have a yellow tint color and the Cancel
button to have a red tint color. I have tried using optionMenu.view.tintColor
, however, that only allows for the setting of every cell, not individual ones.