//
//  MyFont.swift
//  sdk-demo-ios
//
//  Created by Smaato Inc on 05.07.18.
//  Copyright © 2018 Smaato Inc. All rights reserved.
//

import UIKit

enum AppFonts: String {
    case SFDisplay_Semibold = "SFProDisplay-Semibold"
    case SFText_Semibold = "SFProText-Semibold"
    case SFText_Regular = "SFProText-Regular"
    case SFText_Italic = "SFProText-Italic"
}

extension UIFont {

    convenience init?(appFont: AppFonts, size: Int) {
        self.init(name: appFont.rawValue, size: CGFloat(size))
    }

    class func enumerateFonts() {
        for family: String in UIFont.familyNames {
            print("\(family)")
            for names: String in UIFont.fontNames(forFamilyName: family) {
                print("== \(names)")
            }
        }
    }
}
