My app displays a form, and on some of the cells there are textfields where you can enter information. If the cell is towards the bottom of the screen, the cell will be completely blocked which means you can't see what the question is that you are answering. My UITableView is embedded in a UIViewController.
I've looked through many of the threads that propose answers to this problem and implemented some of the code. If I can get this method working, I believe my code will work:
func textFieldDidBeginEditing(_ textField: UITextField) {
if (self.tableView.contentOffset.y == 0)
{
self.tableView.scrollToRow(at: self.tableView.indexPath(for: ), at: UITableViewScrollPosition, animated: true)
}
}
Right now I'm trying to solve the problem of getting the active cell so that it can be inputted into self.tableView.indexPath(for: )
.
How would I go about doing this? Is this the right way to go about moving the view above the keyboard?