1

I recently updated to iOS13 and realized that the textcolor of my actionsheets doesn't change anymore. I use the code below and it works fine if I choose .alert as the preferred style, but when I use .actionSheet the textcolor stays in the default grey.

I extended the UIAlertController-class with an apply-style-function where I do the following:


let attributedTitle = NSAttributedString(string: self.title ?? "", attributes: [NSAttributedString.Key.font : UIFont(name: globals.mainFont, size: 18.0)!, NSAttributedString.Key.foregroundColor : UIColor.white])
let attributedMessage = NSAttributedString(string: self.message ?? "", attributes: [NSAttributedString.Key.font : UIFont(name: globals.mainFont, size: 14.0)!, NSAttributedString.Key.foregroundColor : UIColor.white])
self.setValue(attributedTitle, forKey: "attributedTitle")
self.setValue(attributedMessage, forKey: "attributedMessage")

LarsGvB
  • 267
  • 3
  • 11
  • 1
    Yep, apparently the use of those APIs is no longer working on iOS 13 for .actionSheet. https://stackoverflow.com/questions/58224830/ios-13-uialertcontroller-color-change-in-attributedmessage-and-attributedtitle?noredirect=1#comment102826246_58224830 – Marina Aguilar Oct 07 '19 at 11:46
  • @summerfinn3 Thanks for the fast answer. So I have to build my own actionSheet views from now on, right? – LarsGvB Oct 07 '19 at 11:50
  • 1
    Yes, it will definitely be the best way to go. – Marina Aguilar Oct 07 '19 at 11:51

0 Answers0