I am using the XLFORM library with swift, I want to clear the value of the row after a successfully request .
I am trying to get the row object using self.form.formRowWithTag and changing the value using .value but unfortunately I am not able to get the row's object :(
anyone can help on this ?
I was searching for this answer as well, and your answer gave me inspiration.
What you have done so far is correct. Here is the code:
self.form.formRowWithTag("whatever-tag").value = nil
self.tableView.reloadData()
The key is to reload your UITableView
Hope this helps =)
While the above answer might work, I found out how to do it the way XLForm author wants you to do. On XLForm Github, the author says:
You may have to update the cell to see the UI changes if the row is already presented.
-(void)reloadFormRow:(XLFormRowDescriptor *)formRow
method is provided byXLFormViewController
to do so.
So, you can do this:
var row = self.form.formRowWithTag("whatever-tag")
row.value = nil
self.reloadFormRow(row)
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With