Archive

Monthly Archives: June 2013

I’ve spent some time trying to figure out why my pushed view controller was doing a funny animation instead the simple right-to-left animation. It seamed as if the view of the pushed view controller was treated as a layer and the setting of the views frame was done with an animation.

The problem turned out to be, that this pushing was done in an on complete of a dismissViewController:


[navigationController dismissViewControllerAnimated:YES completion:^{

    FunkyViewController *myFunkyViewController = [[FunkyViewController alloc] init];

    [navigationController pushViewController:myFunkyViewController animated:YES];

}];

The instantiation inside the completion block caused the loading of the view being done inside an animation transaction, which caused the setting of the frame as an animation…

Solution to this, just instantiating outside the completion block

 

FunkyViewController *myFunkyViewController = [[FunkyViewController alloc] init];

    [navigationController dismissViewControllerAnimated:YES completion:^{

    [navigationController pushViewController:myFunkyViewController animated:YES];

}];