Skip to content

Commit 2f2fbd8

Browse files
Fix color of button not being good with xcode 13
1 parent 9735158 commit 2f2fbd8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

TeadsSampleApp/Controllers/RootController/RootControllerCells/RootButtonCollectionViewCell.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class RootButtonCollectionViewCell: UICollectionViewCell {
1919
layer.borderWidth = 1
2020
}
2121

22-
override var isSelected: Bool {
22+
var isButtonSelected: Bool = false {
2323
didSet {
24-
if isSelected {
24+
if isButtonSelected {
2525
label.backgroundColor = .primary
2626
label.textColor = .white
2727
layer.borderColor = UIColor.primary.cgColor

TeadsSampleApp/Controllers/RootController/RootViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ extension RootViewController: UICollectionViewDelegate, UICollectionViewDataSour
165165
}
166166
let cellValue = selectionList[indexPath.item]
167167
cell.label.text = cellValue.name.rawValue
168-
cell.isSelected = cellValue.isSelected
168+
cell.isButtonSelected = cellValue.isSelected
169169
return cell
170170
case 1:
171171
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: buttonCell, for: indexPath) as? RootButtonCollectionViewCell else {
172172
return UICollectionViewCell()
173173
}
174174
if let cellValue = selectionList.first(where: {$0.isSelected})?.providers[indexPath.item] {
175175
cell.label.text = cellValue.name.rawValue
176-
cell.isSelected = cellValue.isSelected
176+
cell.isButtonSelected = cellValue.isSelected
177177
}
178178
return cell
179179
case 2:
@@ -182,7 +182,7 @@ extension RootViewController: UICollectionViewDelegate, UICollectionViewDataSour
182182
}
183183
if let cellValue = selectionList.first(where: {$0.isSelected})?.creativeTypes[indexPath.item] {
184184
cell.label.text = cellValue.name.rawValue
185-
cell.isSelected = cellValue.isSelected
185+
cell.isButtonSelected = cellValue.isSelected
186186
}
187187
return cell
188188
case 3:

0 commit comments

Comments
 (0)