let attributedString = NSAttributedString(string: "Title", attributes: [
NSFontAttributeName : UIFont.systemFontOfSize(15), //your font here
NSForegroundColorAttributeName : UIColor.redColor()
])
let alert = UIAlertController(title: "", message: "", preferredStyle: .alert)
alert.setValue(attributedString, forKey: "attributedTitle")
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (_) in
}
alert.addAction(cancelAction)
present(alert, animated: true, completion: nil)
Added the correct line of code to my answer as it's much more concise than the answer below.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…