From 4632d3caa5978e33247d3ab5615e07ae46779980 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 26 Jan 2024 14:08:40 -0600 Subject: [PATCH] added for intrinsicSize fix Signed-off-by: Matt Bruce --- VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 273f11ff..9cf82696 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -103,6 +103,8 @@ open class ButtonGroup: View { //-------------------------------------------------- // MARK: - Private Properties //-------------------------------------------------- + fileprivate var collectionViewHeight: NSLayoutConstraint? + fileprivate lazy var positionLayout = ButtonGroupPositionLayout().with { $0.position = .center $0.delegate = self @@ -130,6 +132,8 @@ open class ButtonGroup: View { super.setup() addSubview(collectionView) collectionView.pinToSuperView() + collectionViewHeight = heightAnchor.constraint(equalToConstant: VDS.Button.Size.large.height) + collectionViewHeight?.activate() } //-------------------------------------------------- @@ -169,6 +173,7 @@ open class ButtonGroup: View { DispatchQueue.main.async { [weak self] in guard let self else { return } self.collectionView.collectionViewLayout.invalidateLayout() + self.collectionViewHeight?.constant = self.collectionView.intrinsicContentSize.height } } }