반응형 NSAttributedString1 [iOS] NSMutableAttributedString를 통한 UILabel에 Image 삽입하기 (How to insert images into an attributed string with NSTextAttachment) 📄 Swift Source Code import UIKit // MARK: - Extension NSAttributedString Image Protocol extension NSMutableAttributedString { func appendImage(_ image: UIImage) { // MARK: Create our NSTextAttachment. let imageAttchment: NSTextAttchment = NSTextAttchment() imageAttchment.image = image // MARK: Wrap the attachment in its own attributed string so we can append it. let strImage: NSAttributedString .. 2019. 7. 3. 이전 1 다음 반응형