From a1d25b0dfc3e29fe86979e6cce28373f6b8b9452 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 24 May 2023 17:39:53 -0500 Subject: [PATCH] updated to place border with an offset Signed-off-by: Matt Bruce --- VDS/Extensions/UIView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VDS/Extensions/UIView.swift b/VDS/Extensions/UIView.swift index 011380cb..327849fc 100644 --- a/VDS/Extensions/UIView.swift +++ b/VDS/Extensions/UIView.swift @@ -191,7 +191,7 @@ extension CALayer { extension UIView { - public func addBorder(side: UIRectEdge, width: CGFloat, color: UIColor) { + public func addBorder(side: UIRectEdge, width: CGFloat, color: UIColor, offset: CGFloat = 0) { let layerName = borderLayerName(for: side) layer.remove(layerName: layerName) @@ -203,11 +203,11 @@ extension UIView { case .left: borderLayer.frame = CGRect(x: 0, y: 0, width: width, height: frame.height) case .right: - borderLayer.frame = CGRect(x: frame.width - width, y: 0, width: width, height: frame.height) + borderLayer.frame = CGRect(x: frame.width - width - offset, y: 0, width: width, height: frame.height) case .top: borderLayer.frame = CGRect(x: 0, y: 0, width: frame.width, height: width) case .bottom: - borderLayer.frame = CGRect(x: 0, y: frame.height - width, width: frame.width, height: width) + borderLayer.frame = CGRect(x: 0, y: frame.height - width - offset, width: frame.width, height: width) default: break }