Get a problem:
I am having view controller A setup in xib with auto layout and being pushed via pushViewController
from home view controller. Home view controller is embedded in a navigation controller.
I tried to use pushViewController
, push view controller B, another instance of the same class as A,
but I found that, the viewDidAppear
is called in B even before the viewWillLayoutSubviews
and viewDidLayoutSubviews
So when I tried to get a sub view's frame in viewDidAppear
, it is not correct. What's wrong?
Some trace:
2015-10-23 15:02:25.277 Compass[8199:1698308] -[BarLineChartViewController viewWillAppear:] line 89 $ axis chart VC will appear
2015-10-23 15:02:25.286 Compass[8199:1698308] -[BarLineChartViewController viewDidAppear:] line 106 $ axis chart VC did appear
2015-10-23 15:02:25.293 Compass[8199:1698308] -[ChartViewController viewDidAppear:] line 126 $ chart vc viewDidAppear
2015-10-23 15:02:25.298 Compass[8199:1698308] -[BarLineChartViewController viewWillLayoutSubviews] line 95 $ axis chart VC will LayoutSubviews
2015-10-23 15:02:25.303 Compass[8199:1698308] -[BarLineChartViewController viewWillLayoutSubviews] line 95 $ axis chart VC will LayoutSubviews
2015-10-23 15:02:25.310 Compass[8199:1698308] -[BarLineChartViewController viewDidLayoutSubviews] line 100 $ axis chart VC did LayoutSubviews