From 38310b5ab16cddf6c03f7666ebbd00b364795707 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 5 Jun 2024 08:22:22 -0500 Subject: [PATCH] made register static Signed-off-by: Matt Bruce --- VDS/Fonts/Font.swift | 2 +- VDS/Fonts/FontProtocol.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VDS/Fonts/Font.swift b/VDS/Fonts/Font.swift index f4ba798d..6ee9300e 100644 --- a/VDS/Fonts/Font.swift +++ b/VDS/Fonts/Font.swift @@ -48,7 +48,7 @@ public enum Font: FontProtocol { /// - size: Size of the font /// - Returns: UIFont for the fontName and Size. public func font(ofSize size: CGFloat) -> UIFont{ - DispatchQueue.once(block: { self.register() }) + DispatchQueue.once(block: { Self.register() }) switch self { case .custom(let font): return font diff --git a/VDS/Fonts/FontProtocol.swift b/VDS/Fonts/FontProtocol.swift index df6ac6a3..786436b4 100644 --- a/VDS/Fonts/FontProtocol.swift +++ b/VDS/Fonts/FontProtocol.swift @@ -18,7 +18,7 @@ public protocol FontProtocol { extension FontProtocol { /// Registers the fonts used in the VDS Framework. - public func register() { + public static func register() { guard let bundle = Bundle(identifier: "com.vzw.vds") else { return } Self.allCases.forEach{ font in if let url = bundle.url(forResource: font.fontName, withExtension: font.fontFileExtension){ @@ -51,7 +51,7 @@ extension FontProtocol { /// - size: Size of the font /// - Returns: UIFont for the fontName and Size. public func font(ofSize size: CGFloat) -> UIFont{ - DispatchQueue.once(block: { self.register() }) + DispatchQueue.once(block: { Self.register() }) guard let found = UIFont(name: self.fontName, size: size) else { return .systemFont(ofSize: size) } return found }