The reason it shows the view upside down after a light click is not because it removes the transform from the cell. In fact, the transformation in the cell remains as soon as, but segue pulls the cell view out of the context of the tableView. Therefore, the conversion in the cell no longer counteracts the conversion in the table.
, , UIStoryboardSegue, , , . .
, :
func updateTableContentInset() {
let numRows = tableView(self.tableView, numberOfRowsInSection: 0)
var contentInsetTop = self.tableView.bounds.size.height - (self.navigationController?.navigationBar.frame.size.height)! - 20
for i in 0..<numRows {
let rowRect = self.tableView.rectForRow(at: IndexPath(item: i, section: 0))
contentInsetTop -= rowRect.size.height
if contentInsetTop <= 0 {
contentInsetTop = 0
}
}
self.tableView.contentInset = UIEdgeInsetsMake(contentInsetTop, 0, 0, 0)
}
UITableViewController viewDidLoad() , .
updateTableContentInset() :
tableView.scrollToRow(at: indexPath, at: .bottom, animated: true)
, Peek segue.