I am trying to create AttributedString and add the attributes from
typingAttributes(from textView)
The problem is that
.typingAt
Even better solution I think. I created extension.
public extension Dictionary {
func toNSAttributedStringKeys() -> [NSAttributedStringKey: Any] {
var atts = [NSAttributedStringKey: Any]()
for key in keys {
if let keyString = key as? String {
atts[NSAttributedStringKey(keyString)] = self[key]
}
}
return atts
}
}
https://gist.github.com/AltiAntonov/f0f86e7cd04c61118e13f753191b5d9e