Grey text in actionsheets? NSAttributedString.Key not working

I’m having an issue with XCode 11.3 where I am unable to use the NSAttributedString.Key.foreground attribute when creating a custom action sheet. The code I’m using is shown below, and the resulting screengrab is included above.

    let attributedMessageText = NSMutableAttributedString(
        string: description,
        attributes: [
            NSAttributedString.Key.paragraphStyle: paragraphStyle,
            NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0),
            NSAttributedString.Key.foregroundColor: UIColor.red
        ]
    )

When attempting to change the background color, the color turns to gray instead. Has anyone else encountered this issue?

The issue is that you are using NSAttributedString.Key.foreground instead of NSAttributedString.Key.foregroundColor. Replace NSAttributedString.Key.foreground with NSAttributedString.Key.foregroundColor and the issue should be resolved.

    let attributedMessageText = NSMutableAttributedString(
        string: description,
        attributes: [
            NSAttributedString.Key.paragraphStyle: paragraphStyle,
            NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0),
            NSAttributedString.Key.foregroundColor: UIColor.red
        ]
    )