본문 바로가기
개발/swift

UILabel 안에 아이콘 넣기

by 꼬마상어 2016. 11. 18.
반응형
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


반응형

댓글