Move UIFont extension to the file where it’s used.

This commit is contained in:
Brent Simmons
2024-05-06 22:21:37 -07:00
parent 03eff6a0da
commit 482ff49a64
4 changed files with 15 additions and 36 deletions

View File

@@ -1,29 +0,0 @@
//
// UIFont-Extensions.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 4/27/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
extension UIFont {
func withTraits(traits:UIFontDescriptor.SymbolicTraits) -> UIFont {
if let descriptor = fontDescriptor.withSymbolicTraits(traits) {
return UIFont(descriptor: descriptor, size: 0) //size 0 means keep the size as it is
} else {
return self
}
}
func bold() -> UIFont {
return withTraits(traits: .traitBold)
}
func italic() -> UIFont {
return withTraits(traits: .traitItalic)
}
}