updated table

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-21 17:50:24 -05:00
parent 79d1fe9b0f
commit 45780bd898

View File

@ -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")
}
}