diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 9cf82696..ba2a83d8 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -190,8 +190,8 @@ extension ButtonGroup: UICollectionViewDataSource, UICollectionViewDelegate { public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let button = buttons[indexPath.row] guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionViewCell", for: indexPath) as? ButtonGroupCollectionViewCell else { return UICollectionViewCell() } - cell.subviews.forEach { $0.removeFromSuperview() } - cell.addSubview(button) + cell.contentView.subviews.forEach { $0.removeFromSuperview() } + cell.contentView.addSubview(button) button.pinToSuperView() if hasDebugBorder { cell.addDebugBorder()