I\'ve created a method that takes a NSAttributedString and I\'m looking to dynamically create a subview and label to put the string into. Because attributes like font and size n
Swift 4:
If you want to get the attributes for NSTextAttachment (just change the attribute value if you want font)
commentTextView.attributedText.enumerateAttribute(NSAttachmentAttributeName,
in:NSMakeRange(0, commentTextView.attributedText.length),
options:.longestEffectiveRangeNotRequired) {
value, range, stop in
if let attachment = value as? NSTextAttachment {
print("GOT AN ATTACHMENT! for comment at \(indexPath.row)")
}
}