Generalised delegate method
This commit is contained in:
parent
f30d689e14
commit
47b6115ffd
@ -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) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user