Код: Выделить всё
let someText = NSMutableAttributedString(string: "This is a sample text with")
let imageAttachment = NSTextAttachment()
imageAttachment.image = UIImage(named: "icon")
let imageString = NSAttributedString(attachment: imageAttachment)
someText.append(imageString)
someText.append(NSAttributedString(string: "attached")
somelabel.attributedText = someText
Как распознать нажать на изображение (а не на текст), чтобы выполнить действие?
Подробнее здесь: https://stackoverflow.com/questions/599 ... in-a-label
Мобильная версия