I have many textfields
and one textview
at the bottom of the form. All these are embedded in a tableview. I am able to move the tableview
up on click of any textfield
.
Question: How do I achieve the same for a textview
. Any help would be appreciated.
The code that I used to move the tableview
up on click of a textfield
is this -
func textFieldShouldBeginEditing(textField: UITextField) -> Bool {
let txtFieldPosition = textField.convertPoint(textField.bounds.origin, toView: profileTableView)
let indexPath = profileTableView.indexPathForRowAtPoint(txtFieldPosition)
if indexPath != nil {
profileTableView.scrollToRowAtIndexPath(indexPath!, atScrollPosition: .Top, animated: true)
}
return true
}