2019-10-17a few seconds read (About 42 words)How to add trailing image to UILabel in iOSIssue #470 Use NSTextAttachment inside NSAttributedString 123456789101112extension UILabel { func addTrailing(image: UIImage) { let attachment = NSTextAttachment() attachment.image = image let attachmentString = NSAttributedString(attachment: attachment) let string = NSMutableAttributedString(string: self.text!, attributes: [:]) string.append(attachmentString) self.attributedText = string }}#swiftiOS