Skip to content

Instantly share code, notes, and snippets.

View iOSGaurav's full-sized avatar
🏠
Working from home

Gaurav Parmar iOSGaurav

🏠
Working from home
View GitHub Profile
@iOSGaurav
iOSGaurav / Font.swift
Created July 2, 2023 02:46 — forked from ryanrey/Font.swift
UIFont Extension
import UIKit
typealias Font = UIFont
public extension Font {
convenience init(_ family: FontFamily = .system, size: CGFloat = 17.0, weight: FontWeight = FontWeight.regular) {
let descriptor: UIFontDescriptor
if family == .system {
descriptor = UIFont.systemFont(ofSize: size, weight: UIFont.Weight(rawValue: weight.value)).fontDescriptor
} else {