0
NSAttributedString
はUITextView
に設定されていますので、NSAttributedStringKey.foregroundColor
の値を確認する必要があります。NSAttributed文字列の前景色を確認してください
char = attributedText.attributedSubstring(from: attributedRange)
このフィルタを使用しようとしましたが、実際にはどのように使用するのかわかりません。
let attr = char.attributes(at: 0, effectiveRange: nil)
attr.filter({ (<#(key: NSAttributedStringKey, value: Any)#>) -> Bool in
//if true...
})
本当だ...おかげで:)))) –