Level : WORDPRESS BOOK LINKEDIN PATENT Send Mail 동냥하기 hajunho.com

       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"

    }

}

'Python3' 카테고리의 다른 글

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
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기