CXTDT-516206 - ButtonGroup iOS 16 issue

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-02-07 15:45:56 -06:00
parent 329793721f
commit bbc36c72d3

View File

@ -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()