From 9387b0cff9a9f2f0e79cd00eb9abb0de86e18bd3 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 2 Dec 2022 13:47:01 -0600 Subject: [PATCH] refactored to debugBorder Signed-off-by: Matt Bruce --- .../Buttons/ButtonGroup/ButtonGroup.swift | 7 ++++--- VDS/Extensions/UIView.swift | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index cc7c54f4..165ac959 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -149,9 +149,10 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionViewCell", for: indexPath) cell.subviews.forEach { $0.removeFromSuperview() } cell.addSubview(button) - button.pinToSuperView() -// cell.layer.borderColor = UIColor.black.cgColor -// cell.layer.borderWidth = 1 + button.pinLeading() + button.pinTrailing() + button.centerYAnchor.constraint(equalTo: cell.centerYAnchor).isActive = true + //cell.debugBorder() return cell } diff --git a/VDS/Extensions/UIView.swift b/VDS/Extensions/UIView.swift index 0214c67a..eb041400 100644 --- a/VDS/Extensions/UIView.swift +++ b/VDS/Extensions/UIView.swift @@ -116,3 +116,16 @@ extension UIView { } } + + +extension UIView { + public func debugBorder(show shouldShow: Bool = true) { + if shouldShow { + layer.borderColor = UIColor.red.cgColor + layer.borderWidth = 1 + } else { + layer.borderColor = UIColor.clear.cgColor + layer.borderWidth = 0 + } + } +}