I have a container controller and child controllers (similar to UITabViewController). When switching between the representation of one controller of a child view and another view of a controller of a child view, I use:
let oldView = // get reference to old view let newView = // get reference to new view UIView.transition(from: oldView!, to: newView!, duration: 0.3, options: .transitionCrossDissolve, completion: nil)
The problem here is that resizing newView occurs after the transition animation, which looks unsightly, is completed.
This bad behavior only occurs when the new child view controller is loaded for the first time . It seems that the viewDidLayoutSubviews method is only called after the transition.
How do I resize newView before transition, and not after.
Thanks in advance.
source share