【发布时间】:2018-01-05 13:00:53
【问题描述】:
我正在使用以下方法在 Swift 3 中将我的 textView.typingAttributes 前景色设置为红色。
textView.typingAttributes[NSForegroundColorAttributeName] = UIColor.red
现在,我已经迁移到 Swift 4,它的显示错误,我尝试如下,但它仍然显示错误。正确的设置方法是什么?
textView.typingAttributes[NSAttributedStringKey.foregroundColor] = UIColor.red
【问题讨论】:
标签: ios uitextview nsattributedstring swift4 xcode9-beta