When using a collectionView
on the iPad and rotating
it, I call:
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
collectionView.collectionViewLayout.invalidateLayout()
}
Is it necessary to do the same thing with a tableView
?
I got the below code from this older answer
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
tableView.beginUpdates()
tableView.endUpdates()
}