TPKeyboardAvoiding
TPKeyboardAvoiding copied to clipboard
How to scroll to top?
I was able to implement TPKeyboardAvoidingTableView pretty simply by setting the Class to it. However, how do I scroll to the top of the table after making a specific cell becomeFirstResponder()?
If I set a textfield in the 1st row becomeFirstResponder(), the table scrolls all the way to the bottom. I tried this:
tableView.setContentOffset(CGPointMake(0.0, -tableView.contentInset.top), animated: true)
and it doesn't work. TPKeyboardAvoidingTableView seems to have scrollToActiveTextField but I'm not sure how to use it.