Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Edited: added another option with controller containment for iOS 5 and later.</p> <p><strong>Another solution is to set the layer's time space.</strong></p> <p>This is done through the speed property of CALayer. To slow the animation down, one could use:</p> <pre><code>MytransparentVCViewController *vc = [[MytransparentVCViewController alloc] initWithNibName:@"MytransparentVCViewController" bundle:nil]; // Makes all animations 10 times slower // To speed it up, set it to multiples of 1: 2 is 2 times faster, 3 is 3 times faster etc vc.view.layer.speed = 0.1; [self presentModalViewController:vc animated:YES]; </code></pre> <p>Note that the proposed solution in the linked post will not work if your objective is to change the animation speed of the modal view controller you are about to present (for example if you use UIModalTransitionStyleCoverVertical).</p> <p>The layer's speed is not an absolute value but a function of that layer's parent time space (unless the layer is in the root of the layer hierarchy of course). For example, when you set a layer's speed to 2, its animations will run twice as fast in comparison to that layer parent's animations.</p> <p><strong>Yet another option is to use view controller containment. (iOS 5 and later only)</strong> </p> <p><a href="http://developer.apple.com/library/ios/DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW81" rel="noreferrer">http://developer.apple.com/library/ios/DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW81</a>.</p> <p>You have full control over the animation with UIViewController's transitionFromViewController:toViewController:duration:options:animations:completion:.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload