View size is not updating in ViewWillAppear method in iOS 9.

I have an iOS app which support for

Orientation
. Till
iOS 8.4
it was giving us an correct view size (width and Height) in
viewWillAppear
method according to
Orientation
changed. But now I ran my existing app in
Xcode 7
with
iOS 9,
then
Orientation
has broken as the View size is not updating in
viewWillAppear
method. I am updating all my controllers of frame/size through
viewWillAppear
method, but now its not working. Is it a bug or you designed architecture like this specially for iOS 9. I am using
Xib
without any
Autolayout
enabled.

You should use UIViewController's viewDidLayoutSubviews.

Thank you. Its working fine now. Why viewDidLayoutSubviews function getting call more than two times? even I tried with viewWillLayoutSubviews function but here also same.

And just for clarification viewDidLayoutSubviews and viewWillLayoutSubviews methods will invoke every time when we changes Orienatation?

There are no restrictions on how many times the system can request that layout occur. Your view controller must be prepared to handle multiple invocations of -viewWillLayoutSubviews/viewDidLayoutSubviews.

View size is not updating in ViewWillAppear method in iOS 9.
 
 
Q