How to get safeAreaInsets in viewWillTransitionToSize (iPhone X)
I got the valid solution at Stackoverflow Japan.
It's just getting the insets in the UIViewControllerTransitionCoordinator.animate(alongsideTransition:completion:)
closure like below:
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
coordinator.animate(alongsideTransition: { (context) in
...
let insets = ...safeAreaInsets
...
}, completion: nil)
}