You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably an easy one, but I'm breaking my head here and have wasted a lot of time with no solution. I created a very simple custom "SUBMIT" button row with its own custom cell, the cell only has one button called titleButton, here's the setup of the cell:
section <<< VIBlueButtonRow() { row in
row.value = "Submit"
}.onCellSelection({ (cell, row) in
print("cell selected?")
})
I want the cell to get selected when onTitleButtonPressed is called; but so far I can't figure it out... I have tried all of the following commented lines, none seem to work:
Any ideas? It doesn't have to be "onCellSelection", any of the other row methods will do. What I need is a way of knowing - at the form level - that the custom button was pressed, so i can process the form values.
The text was updated successfully, but these errors were encountered:
OnCellSelection should be automatically called when the cell is selected. You could try with cell.didSelect() but that should happen automatically, unless obviously the button's action is triggered instead of the cell selection.
What happens if you remove the line: titleButton?.addTarget(self, action: #selector(VIBlueButtonCell.onTitleButtonPressed), forControlEvents: .TouchUpInside)
Nevertheless, cell.didSelect() should work for you
"onTitleButtonPressed" is a method located in the cell, not the row, and what I wanted to call was the row's "onCellSelection" method... so the fix is this:
public func onTitleButtonPressed() {
self.baseRow.didSelect()
}
And now I can intercept the "onCellSelection" method at the form level.
Thanks for the help, you can close this issue now.
Hey,
This is probably an easy one, but I'm breaking my head here and have wasted a lot of time with no solution. I created a very simple custom "SUBMIT" button row with its own custom cell, the cell only has one button called titleButton, here's the setup of the cell:
Then I add it to my form like this:
I want the cell to get selected when onTitleButtonPressed is called; but so far I can't figure it out... I have tried all of the following commented lines, none seem to work:
Any ideas? It doesn't have to be "onCellSelection", any of the other row methods will do. What I need is a way of knowing - at the form level - that the custom button was pressed, so i can process the form values.
The text was updated successfully, but these errors were encountered: