diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 7495635c..99b17753 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ EA0B18022A9E236900F2D0CD /* SelectorGroupBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0B18012A9E236900F2D0CD /* SelectorGroupBase.swift */; }; EA0B18052A9E2D2D00F2D0CD /* SelectorBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0B18032A9E2D2D00F2D0CD /* SelectorBase.swift */; }; EA0B18062A9E2D2D00F2D0CD /* SelectorItemBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0B18042A9E2D2D00F2D0CD /* SelectorItemBase.swift */; }; + EA0B180A2AA78F9000F2D0CD /* UIEdgeInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0B18092AA78F9000F2D0CD /* UIEdgeInsets.swift */; }; EA0D1C372A681CCE00E5C127 /* ToggleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0D1C362A681CCE00E5C127 /* ToggleView.swift */; }; EA0D1C392A6AD4DF00E5C127 /* Typography+SpacingConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0D1C382A6AD4DF00E5C127 /* Typography+SpacingConfig.swift */; }; EA0D1C3B2A6AD51B00E5C127 /* Typogprahy+Styles.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0D1C3A2A6AD51B00E5C127 /* Typogprahy+Styles.swift */; }; @@ -160,6 +161,7 @@ EA0B18012A9E236900F2D0CD /* SelectorGroupBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectorGroupBase.swift; sourceTree = ""; }; EA0B18032A9E2D2D00F2D0CD /* SelectorBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectorBase.swift; sourceTree = ""; }; EA0B18042A9E2D2D00F2D0CD /* SelectorItemBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectorItemBase.swift; sourceTree = ""; }; + EA0B18092AA78F9000F2D0CD /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = ""; }; EA0D1C362A681CCE00E5C127 /* ToggleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleView.swift; sourceTree = ""; }; EA0D1C382A6AD4DF00E5C127 /* Typography+SpacingConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Typography+SpacingConfig.swift"; sourceTree = ""; }; EA0D1C3A2A6AD51B00E5C127 /* Typogprahy+Styles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Typogprahy+Styles.swift"; sourceTree = ""; }; @@ -478,6 +480,7 @@ EA3361A7288B23300071C351 /* UIColor.swift */, EA81410F2A127066004F60D2 /* UIColor+VDSColor.swift */, EA33623D2892EE950071C351 /* UIDevice.swift */, + EA0B18092AA78F9000F2D0CD /* UIEdgeInsets.swift */, EAF7F0B6289C12A600B287F5 /* UITapGestureRecognizer.swift */, EA8E40902A7D3F6300934ED3 /* UIView+Accessibility.swift */, EAB5FED329267EB300998C17 /* UIView+NSLayoutConstraint.swift */, @@ -982,6 +985,7 @@ EAF978212A99035B00C2FEA9 /* Enabling.swift in Sources */, EA5E3058295105A40082B959 /* Tilelet.swift in Sources */, EA89201528B56CF4006B9984 /* RadioBoxGroup.swift in Sources */, + EA0B180A2AA78F9000F2D0CD /* UIEdgeInsets.swift in Sources */, EA985C1D296CD13600F2FF2E /* BundleManager.swift in Sources */, EA0B18052A9E2D2D00F2D0CD /* SelectorBase.swift in Sources */, EAC71A1D2A2E155A00E47A9F /* Checkbox.swift in Sources */, diff --git a/VDS/Extensions/UIEdgeInsets.swift b/VDS/Extensions/UIEdgeInsets.swift new file mode 100644 index 00000000..650a6d16 --- /dev/null +++ b/VDS/Extensions/UIEdgeInsets.swift @@ -0,0 +1,49 @@ +// +// UIEdgeInset.swift +// VDS +// +// Created by Matt Bruce on 9/5/23. +// + +import Foundation +import UIKit + +extension UIEdgeInsets { + + public static func uniform(_ value: CGFloat) -> UIEdgeInsets { + return UIEdgeInsets(top: value, left: value, bottom: value, right: value) + } + + public static func top(_ value: CGFloat) -> UIEdgeInsets { + return UIEdgeInsets(top: value, left: 0, bottom: 0, right: 0) + } + + public static func left(_ value: CGFloat) -> UIEdgeInsets { + return UIEdgeInsets(top: 0, left: value, bottom: 0, right: 0) + } + + public static func bottom(_ value: CGFloat) -> UIEdgeInsets { + return UIEdgeInsets(top: 0, left: 0, bottom: value, right: 0) + } + + public static func right(_ value: CGFloat) -> UIEdgeInsets { + return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: value) + } + + public static func horizontal(_ value: CGFloat) -> UIEdgeInsets { + return UIEdgeInsets(top: 0, left: value, bottom: 0, right: value) + } + + public static func vertical(_ value: CGFloat) -> UIEdgeInsets { + return UIEdgeInsets(top: value, left: 0, bottom: value, right: 0) + } + + public static func axis(horizontal: CGFloat, vertical: CGFloat) -> UIEdgeInsets { + return UIEdgeInsets(top: vertical, left: horizontal, bottom: vertical, right: horizontal) + } + +} + +public func + (lhs: UIEdgeInsets, rhs: UIEdgeInsets) -> UIEdgeInsets { + return .init(top: lhs.top + rhs.top, left: lhs.left + rhs.left, bottom: lhs.bottom + rhs.bottom, right: lhs.right + rhs.right) +}