made register static

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-06-05 08:22:22 -05:00
parent 0207b70a20
commit 38310b5ab1
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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
}