let yourAttributes : [NSAttributedStringKey: Any] = [
NSAttributedStringKey.font : UIFont(name: "".font1(), size: 14)!,
NSAttributedStringKey.foregroundColor : UIColor.black,
NSAttributedStringKey.underlineStyle : NSUnderlineStyle.styleNone.rawValue]
let attributeString = NSMutableAttributedString(string: "TxtWhatYouWantToWrite",
attributes: yourAttributes)
btn.setAttributedTitle(attributeString, for: .normal)
btn.endEditing(false)
폰트 지정은
import UIKit
//Where am I, exactly ex) "".pwd(self)
extension String {
func pwd(_ x: Any) {
if(!GS.s.logLevel.contains(.none)) {
if x is String {
print("🍭pwd_\(x)")
} else {
print("🍭pwd_", String(describing: x.self))
}
}
}
func pwdJustString(_ x: Any) -> String {
return String(describing: x.self)
}
func font1() -> String {
return "NanumSquareOTFR"
}
func font1L() -> String {
return "NanumSquareOTFL"
}
func font1B() -> String {
return "NanumSquareOTFB"
}
func font2() -> String {
return "Pecita"
}
}
'[진행] {BE} Python 3.1x' 카테고리의 다른 글
Making mater-detail app to hadle imageView (0) | 2020.06.23 |
---|---|
swift4 날짜 date 형식 formatting (2) | 2020.06.23 |
Alamofire SwiftyJSON (0) | 2020.06.23 |
log 출력 (0) | 2020.06.23 |
SwiftMessages 사용법 (0) | 2020.06.23 |
최근댓글