From 45780bd898c763d12143527603e9ae03593c26e4 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 21 Aug 2023 17:50:24 -0500 Subject: [PATCH] updated table Signed-off-by: Matt Bruce --- .../Buttons/ButtonGroup/ButtonGroup.swift | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index fba66594..e15bea2c 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -11,8 +11,12 @@ import VDSColorTokens import VDSFormControlsTokens import Combine +public protocol Refreshablable { + var onRefresh: (()->Void)? { get set } +} + @objc(VDSButtonGroup) -open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, ButtongGroupPositionLayoutDelegate { +open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, ButtongGroupPositionLayoutDelegate, Refreshablable { //-------------------------------------------------- // MARK: - Enums @@ -135,7 +139,6 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega super.setup() addSubview(collectionView) collectionView.pinToSuperView() - backgroundColor = .red } //-------------------------------------------------- @@ -155,9 +158,12 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega DispatchQueue.main.async { [weak self] in guard let self else { return } self.collectionView.collectionViewLayout.invalidateLayout() + self.onRefresh?() } } - + + open var onRefresh: (() -> Void)? + //-------------------------------------------------- // MARK: - UICollectionViewDataSource //-------------------------------------------------- @@ -198,7 +204,4 @@ 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") - } }