1
这就是我想实现:NSRangePointer错误斯威夫特
var range : NSRange? = NSMakeRange(0, (attributedString?.length)!)
attributedString?.attribute(NSFontAttributeName: UIFont.fontNames(forFamilyName: "OpenSans-Regular"), at: 1, effectiveRange: &range)
在第二行,我收到一个编译时错误:
Argument labels '(NSFontAttributeName:, at:, effectiveRange:)' do not match any available overloads
如何添加此属性。无法找到只接受属性的NSAttributedString的重载函数 – Nitish
请参阅我对您的其他问题的评论。您正在使用错误的方法来添加属性。 – rmaddy
如何在documentAttributes中添加字体? – Nitish