mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Change master feed list to use preferred fonts.
This commit is contained in:
26
iOS/Extensions/UIFont-Extensions.swift
Normal file
26
iOS/Extensions/UIFont-Extensions.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// 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 {
|
||||
let descriptor = fontDescriptor.withSymbolicTraits(traits)
|
||||
return UIFont(descriptor: descriptor!, size: 0) //size 0 means keep the size as it is
|
||||
}
|
||||
|
||||
func bold() -> UIFont {
|
||||
return withTraits(traits: .traitBold)
|
||||
}
|
||||
|
||||
func italic() -> UIFont {
|
||||
return withTraits(traits: .traitItalic)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user