개발/swift
UILabel 안에 아이콘 넣기
꼬마상어
2016. 11. 18. 14:33
반응형
let attachment = NSTextAttachment()
attachment.image = UIImage(named: "yourIcon.png")
let attachmentString = NSAttributedString(attachment: attachment)
let myString = NSMutableAttributedString(string: price)
myString.appendAttributedString(attachmentString)
label.attributedText = myString
반응형