Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 460 Bytes

File metadata and controls

18 lines (13 loc) · 460 Bytes

RemoteImageTextAttachment

NSTextAttachment with remote image URL

Usage

let attachment = RemoteImageTextAttachment(imageURL: url, displaySize: CGSize(width: 100, height: 100))
let attributedText = NSMutableAttributedString()
attributedText.append(NSAttributedString(attachment: attachment))

// For UITextView/NSTextView
textView.attributedText = attributedText

// For UILabel
attachment.label = label
label.attributedText = attributedText