swift - Swift 4设置NSAttributedString的颜色的字体(Font)

iSwift

2018-01-04T08:36:11Z||2018-01-04T08:36:11Z

let attributes = [NSAttributedStringKey.foregroundColor: UIColor.green, NSAttributedStringKey.font: UIFont(name: "system", size: 12)]
let attrString = NSAttributedString(string: "haha", attributes: attributes)