After playing around with segue, I have found that my UITableView lags for unknown reasons after performing a segue. Please see video: https://www.youtube.com/watch?v=mPAVcvf9UcE source code: http://pastebin.com/c62UZiNx
I have faced the problem after following the solution for this question: How can I get the UITableView scroll position so I can save it?
The only way I managed to fix this is by creating a CGPoint (like CGPointMake(0,20) ) rather than remembering it when the segue occurs.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showDetailedPost" {
if let vc = segue.destinationViewController as? DetailedPostVC {
offset = tableView.contentOffset
vc.num = tableView.indexPathForSelectedRow()!.row
}
}
}
This does not seem to fix the problem:
override func viewWillDisappear(animated: Bool) {
offset = tableView.contentOffset
}
override func viewWillAppear(animated: Bool) {
tableView.contentOffset = offset
}