diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift index 458acfdf..ff3452fb 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift @@ -39,7 +39,7 @@ open class RadioBox: Control { super.setupView() layer.delegate = self - layer.borderColor = UIColor.mfGet(forHex: "#747676").cgColor + layer.borderColor = UIColor.mvmCoolGray6.cgColor layer.borderWidth = 1 label.numberOfLines = 1 @@ -77,7 +77,7 @@ open class RadioBox: Control { // Draw the strikethrough strikeLayer?.removeFromSuperlayer() if isOutOfStock { - let line = getStrikeThrough(color: isSelected ?.black:UIColor.mfGet(forHex: "#747676") , thickness: 1) + let line = getStrikeThrough(color: isSelected ? .black : .mvmCoolGray6, thickness: 1) layer.addSublayer(line) strikeLayer = line } @@ -110,6 +110,7 @@ open class RadioBox: Control { } @objc open func selectBox() { + guard isEnabled else { return } isSelected = true radioBoxModel?.selected = isSelected layer.setNeedsDisplay() diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift index 9fa451f6..4b42e9a8 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift @@ -112,10 +112,6 @@ extension RadioBoxes: UICollectionViewDataSource { open func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return boxes?.count ?? 0 } - public func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool { - guard let molecule = boxes?[indexPath.row] else {return true } - return molecule.enabled - } open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let molecule = boxes?[indexPath.row], @@ -134,6 +130,11 @@ extension RadioBoxes: UICollectionViewDataSource { } extension RadioBoxes: UICollectionViewDelegate { + public func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool { + guard let molecule = boxes?[indexPath.row] else { return false } + return molecule.enabled + } + public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { guard let cell = collectionView.cellForItem(at: indexPath) as? RadioBoxCollectionViewCell else { return } cell.radioBox.selectBox()