개발/아이오에스
swift-xcode ] 커스텀 폰트 적용하기 - 코드(no StoryBoard)
dev.jake
2021. 12. 3. 13:15
//
// Extensions.swift
// LL
//
// Created by devgeeyong on 2021/12/03.
//
import UIKit
extension UIFont {
class func PoorStory(type: PoorStoryType, size: CGFloat) -> UIFont!{
guard let font = UIFont(name: type.name, size: size) else{
return nil
}
return font
}
public enum PoorStoryType{
case Bold
var name: String{
switch self{
case .Bold:
return "PoorStory-Regular"
}
}
}
}
//적용하기
label.font = UIFont.PoorStory(type: .Bold, size: 30)