-1

I want to change the color of title of UIAlertActionSheet.

"alert.view.tintColor" changes the color of all the action buttons but not title.

  • There is no such thing as a UIAlertActionSheet. – matt Dec 02 '20 at 15:44
  • https://stackoverflow.com/questions/31662591/swift-how-to-change-uialertcontrollers-title-color/31688708 – Kstin Dec 02 '20 at 15:45
  • By UIAlertActionSheet, I mean when the preferred style of UIAlertController is actionSheet – Bhanu Kashyap Dec 02 '20 at 16:01
  • I wouldn't as it's using private properties that might change on next release and might make your app crash. I would use a custom alert that looks like a `UIAlertController`. – Larme Dec 02 '20 at 16:29

1 Answers1

0

you can try this an it may work with you

let myCancelAlert = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.default, handler:nil)
            myCancelAlert.setValue(UIColor.black, forKey: "titleTextColor")
            alert.addAction(cancelAlert)
Menaim
  • 937
  • 7
  • 28