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 }