I'm trying to scroll to the last row of a table view after a user has added a comment to a feed:
self.loadDataFromParse();
// load the last row
let numberOfSections = self.tableView.numberOfSections()
let numberOfRows = self.tableView.numberOfRowsInSection(numberOfSections-1)
if numberOfRows > 0 {
println(numberOfSections)
let indexPath = NSIndexPath(forRow: numberOfRows-1, inSection: (numberOfSections-1))
self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: UITableViewScrollPosition.Bottom, animated: true)
}
But tableview
only scrolls to about half / 3/4 of the way.
Any input appreciated