Generalised delegate method

This commit is contained in:
rajampetS 2021-07-05 13:56:53 +05:30
parent f30d689e14
commit 47b6115ffd

View File

@ -9,7 +9,7 @@
import Foundation import Foundation
public protocol RadioBoxSelectionDelegate: class { public protocol RadioBoxSelectionDelegate: class {
func selectedRadioBox(text: String) func selected(radioBox: RadioBoxModel)
} }
open class RadioBoxes: View { open class RadioBoxes: View {
@ -167,7 +167,7 @@ extension RadioBoxes: UICollectionViewDelegate {
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate) _ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
cell.updateAccessibility() cell.updateAccessibility()
guard let radioBox = boxes?[indexPath.row] else { return } guard let radioBox = boxes?[indexPath.row] else { return }
radioDelegate?.selectedRadioBox(text: radioBox.text) radioDelegate?.selected(radioBox: radioBox)
} }
open func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) { open func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {