diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index ed3a2c15..fba66594 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -135,6 +135,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega super.setup() addSubview(collectionView) collectionView.pinToSuperView() + backgroundColor = .red } //-------------------------------------------------- @@ -150,11 +151,11 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega open override func layoutSubviews() { super.layoutSubviews() -// // Accounts for any collection size changes -// DispatchQueue.main.async { [weak self] in -// guard let self else { return } -// self.collectionView.collectionViewLayout.invalidateLayout() -// } + // Accounts for any collection size changes + DispatchQueue.main.async { [weak self] in + guard let self else { return } + self.collectionView.collectionViewLayout.invalidateLayout() + } } //-------------------------------------------------- @@ -197,5 +198,7 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega public func collectionView(_ collectionView: UICollectionView, buttonableAtIndexPath indexPath: IndexPath) -> Buttonable { buttons[indexPath.row] } - + public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + print("index") + } } diff --git a/VDS/Components/Buttons/TextLink/TextLink.swift b/VDS/Components/Buttons/TextLink/TextLink.swift index ca7aac1d..e0856e83 100644 --- a/VDS/Components/Buttons/TextLink/TextLink.swift +++ b/VDS/Components/Buttons/TextLink/TextLink.swift @@ -64,10 +64,6 @@ open class TextLink: ButtonBase { super.init(coder: coder) } - private var line = UIView().with { - $0.translatesAutoresizingMaskIntoConstraints = false - } - //-------------------------------------------------- // MARK: - Public Functions //-------------------------------------------------- @@ -76,13 +72,6 @@ open class TextLink: ButtonBase { isAccessibilityElement = true accessibilityTraits = .link if let titleLabel { - addSubview(line) - line.pinLeading(titleLabel.leadingAnchor) - line.pinTrailing(titleLabel.trailingAnchor) - line.pinTop(titleLabel.bottomAnchor) - line.pinBottom(bottomAnchor) - lineHeightConstraint = line.heightAnchor.constraint(equalToConstant: 1.0) - lineHeightConstraint?.isActive = true titleLabel.debugBorder(show: true) } } @@ -106,14 +95,9 @@ open class TextLink: ButtonBase { open override var intrinsicContentSize: CGSize { return titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize } - - /// Function used to make changes to the View based off a change events or from local properties. - open override func updateView() { - //need to set the properties so the super class - //can render out the label correctly - line.backgroundColor = textColor - //always call last so the label is rendered - super.updateView() + open override func layoutSubviews() { + super.layoutSubviews() + addBorder(side: .bottom, width: 1, color: textColor) } }