To change the text colour of UILable at runtime use NSAttributedText and do not set UILable.textColor.
let font = UIFont(name: "SFProText-Semibold", size: 16)!
if let messageToDisplay = currentUser?.lastMessage {
let attributedString = NSAttributedString(string: messageToDisplay, attributes: [NSAttributedString.Key.font: font, NSAttributedString.Key.foregroundColor: UIColor(named: "charcoal")!])
lastMessageLabel.attributedText = attributedString
} else {
let attributedString = NSAttributedString(string: "Start a conversation", attributes: [NSAttributedString.Key.font: font, NSAttributedString.Key.foregroundColor: UIColor(named: "ocean")!])
lastMessageLabel.attributedText = attributedString
}
Note charcoal and ocean are colours defined in Assets.xcassets. Resultant Label Images:
Above code worked well for me in Xcode 10.2.1 and Swift 5.