diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 1362d68d..1bc28dba 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -13,9 +13,16 @@ import Combine @objc(VDSButtonGroup) open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UICollectionViewDelegate, ButtongGroupPositionLayoutDelegate { + + //-------------------------------------------------- + // MARK: - Enums + //-------------------------------------------------- + public enum ButtonPosition: String, CaseIterable { + case left, center, right + } //-------------------------------------------------- - // MARK: - Properties + // MARK: - Public Properties //-------------------------------------------------- //An object containing number of Button components per row, in each viewport open var rowQuantityPhone: Int = 0 { didSet { didChange() } } diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroupPositionLayout.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroupPositionLayout.swift index eead60ba..06dde682 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroupPositionLayout.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroupPositionLayout.swift @@ -47,7 +47,7 @@ class ButtonCollectionViewRow { } } - func layout(for position: ButtonPosition, with collectionViewWidth: CGFloat){ + func layout(for position: ButtonGroup.ButtonPosition, with collectionViewWidth: CGFloat){ var offset = 0.0 let height = rowHeight attributes.last?.spacing = 0 @@ -120,10 +120,6 @@ class ButtonCollectionViewRow { } } -public enum ButtonPosition: String, CaseIterable { - case left, center, right -} - protocol ButtongGroupPositionLayoutDelegate: AnyObject { func collectionView(_ collectionView: UICollectionView, sizeForItemAtIndexPath indexPath: IndexPath) -> CGSize func collectionView(_ collectionView: UICollectionView, buttonableAtIndexPath indexPath: IndexPath) -> any Buttonable @@ -154,7 +150,7 @@ class ButtonGroupPositionLayout: UICollectionViewLayout { // Total height of the content. Will be used to configure the scrollview content var layoutHeight: CGFloat = 0.0 - var position: ButtonPosition = .left + var position: ButtonGroup.ButtonPosition = .left var rowQuantity: Int = 0 var buttonPercentage: CGFloat?