I designed a UITableView containing 3 different cell prototypes. I'm trying to figure out how I can capture their user inputs. One of them has a checklist in the form of a nested table view, so I need the ones they selected. Another has a UIPickerView so I need the selected option from a PickerView. Last one is a text area so I need the string inputting in that.
So I not only need a mechanism to capture the data to repopulate it back with their inputs when the user scrolls up or down to make it visible again. Would the best option be to use the following delegate function to capture non-visible cells:
func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {
// do something with the cell before it gets deallocated
}
and then capture data on the visible cells on form submission? I'm not sure if this approach would work, so I'm wondering if there are better options.
The form input data would be 1 to many sections of self-repeating cells for sections 2 and up, so I need a way to capture all the input data with the TableView dequeuing these cells.
Eureka, its a pretty good form library. - Koh