I have AViewController
. Inside A
, I have a MapViewController
instance. MapViewController
is A
's Child View Controller.
Now when a button inside A
got TouchUpInside
, I init a BViewController
. and present B
.
When init BViewController
I pass in the MapViewController
to B
and stored inside B
as an unowned variable.
I need to display the same map for both A
and B
. Inside B
's viewDidLoad
, I add MapViewController
as Child View Controller for B
.
The app freezes when I press the button. No exception, No crash, No error log.
Anyone have any ideas why it happens?
MapViewController
as child inside B
at ViewWillAppear
, same result, app freezesMapViewController
as child inside B
at ViewDidAppear
, no more freeze, but map is not there at all.B
I tried to add B
as childViewController of A
, same result, app freezesmapViewController
as child in A
before present B
, same result, app freezes.mapViewController
as child in completion block when present B
, same result, app freezesThis may be a better structure to take. When you switch from A
content to B
content, you can move / size the elements all you want... And since they will be separate subviews of your "main" view, they can overlap if your interface would benefit from that layout: