From 30fe60ddb89d953f49639ff8dfaccf2ba578ae7d Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 28 Jul 2022 11:20:07 -0500 Subject: [PATCH] refactored into extension Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 4 ++++ VDS/Extensions/UIDevice.swift | 15 +++++++++++++++ VDS/Typography/VDSFontStyles.swift | 6 ------ 3 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 VDS/Extensions/UIDevice.swift diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 02b996fe..3f1fde97 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -36,6 +36,7 @@ EA33622E2891EA3C0071C351 /* DispatchQueue+Once.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33622D2891EA3C0071C351 /* DispatchQueue+Once.swift */; }; EA3362302891EB4A0071C351 /* VDSFonts.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33622F2891EB4A0071C351 /* VDSFonts.swift */; }; EA3362322891F2ED0071C351 /* VDSFontStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3362312891F2ED0071C351 /* VDSFontStyles.swift */; }; + EA33623E2892EE950071C351 /* UIDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33623D2892EE950071C351 /* UIDevice.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -79,6 +80,7 @@ EA33622D2891EA3C0071C351 /* DispatchQueue+Once.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DispatchQueue+Once.swift"; sourceTree = ""; }; EA33622F2891EB4A0071C351 /* VDSFonts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSFonts.swift; sourceTree = ""; }; EA3362312891F2ED0071C351 /* VDSFontStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSFontStyles.swift; sourceTree = ""; }; + EA33623D2892EE950071C351 /* UIDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIDevice.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -178,6 +180,7 @@ children = ( EA3361A7288B23300071C351 /* UIColor.swift */, EA33622D2891EA3C0071C351 /* DispatchQueue+Once.swift */, + EA33623D2892EE950071C351 /* UIDevice.swift */, ); path = Extensions; sourceTree = ""; @@ -371,6 +374,7 @@ EA3361B6288B2A410071C351 /* Control.swift in Sources */, EA3361B1288B26490071C351 /* Invertable.swift in Sources */, EA3361AD288B26190071C351 /* DataTrackable.swift in Sources */, + EA33623E2892EE950071C351 /* UIDevice.swift in Sources */, EA3362302891EB4A0071C351 /* VDSFonts.swift in Sources */, EA3361B8288B2AAA0071C351 /* ViewProtocol.swift in Sources */, EA3361BF288B2EA60071C351 /* Modelable.swift in Sources */, diff --git a/VDS/Extensions/UIDevice.swift b/VDS/Extensions/UIDevice.swift new file mode 100644 index 00000000..ccce58c9 --- /dev/null +++ b/VDS/Extensions/UIDevice.swift @@ -0,0 +1,15 @@ +// +// UIDevice.swift +// VDS +// +// Created by Matt Bruce on 7/28/22. +// + +import Foundation +import UIKit + +extension UIDevice { + public static var isIPad: Bool { + UIDevice.current.userInterfaceIdiom == .pad + } +} diff --git a/VDS/Typography/VDSFontStyles.swift b/VDS/Typography/VDSFontStyles.swift index 3370bc74..f4f1daef 100644 --- a/VDS/Typography/VDSFontStyles.swift +++ b/VDS/Typography/VDSFontStyles.swift @@ -197,9 +197,3 @@ public enum VDSFontStyle: String, Codable { return fontStyle.font } } - -extension UIDevice { - static var isIPad: Bool { - UIDevice.current.userInterfaceIdiom == .pad - } -}