Study/Swift
UITextView 부분 Bold
힝쏘
2021. 6. 23. 15:49
한참 찾았다.
\n\n 쓰면서 <b></b> 되는 것을 찾고 있었지만 어차피 bold 적용하는 것 같아서 아래와 같이 적용하니까
심플하게 끝
let normalAttrs = [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 15)]
let boldAttrs = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 15)]
let temp = NSMutableAttributedString(string: memo, attributes:normalAttrs)
temp.append(NSMutableAttributedString(string: content, attributes:boldAttrs))
uitextview.attributedText = temp