我正在尝试使用NSMutableAttributedString
的初始值:
NSMutableAttributedString(attachment: NSTextAttachment())
但是我收到了错误:
参数标签“
(attachment:)
”与任何可用的重载都不匹配。
答案 0 :(得分:0)
您应首先使用附件创建NSAttributedString
,然后从中初始化可变字符串:
let attrString = NSAttributedString(attachment: textAttachment)
let mutableAttrString = NSMutableAttributedString(attributedString: attrString)