Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There's going to be a penalty each time you load a new view, you could attempt to consolidate screens using a scroll view or a different layout. Also, if you are loading any unnecessary graphics you may want to remove them.</p> <p>You could also add each view as a subview yourself in which case you have control over the animation duration among other things. This code will do that for you, although beware as I just wrote it and did not test it (The transition style and boolean parameters can be removed as they do nothing right now).</p> <p>UIViewControllerExtendedPresentModalViewController.h</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; typedef enum _ExtendedModalTransitionStyle { ExtendedModalTransitionStyleTopDown } ExtendedModalTransitionStyle; @interface UIViewController ( ExtendedPresentModalViewController ) - (void)presentModalViewController: (UIViewController*)modalViewController withTransitionStyle: (ExtendedModalTransitionStyle)style animated: (BOOL)animated; - (void)dismissModalViewController: (UIViewController*)modalViewController withTransitionStyle: (ExtendedModalTransitionStyle)style animated: (BOOL)animated; @end </code></pre> <p>UIViewControllerExtendedPresentModalViewController.m</p> <pre><code>#import "UIViewControllerExtendedPresentModalViewController.h" #import &lt;QuartzCore/QuartzCore.h&gt; @implementation UIViewController ( ExtendedPresentModalViewController ) - (void)presentModalViewController: (UIViewController*)modalViewController withTransitionStyle: (ExtendedModalTransitionStyle)style animated: (BOOL)animated { [modalViewController retain]; // we'll need this for a little while, hang on to it. CATransition* transition = [CATransition animation]; [transition setDuration: 0.4]; [transition setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]]; [transition setType: kCATransitionMoveIn]; [transition setSubtype: kCATransitionFromBottom]; [[[self view] layer] addAnimation: transition forKey: nil]; [[self view] addSubview: [modalViewController view]]; } - (void)dismissModalViewController: (UIViewController*)modalViewController withTransitionStyle: (ExtendedModalTransitionStyle)style animated: (BOOL)animated { CATransition* transition = [CATransition animation]; [transition setDuration: 0.4]; [transition setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]];//kCAMediaTimingFunctionEaseInEaseOut]]; [transition setType: kCATransitionReveal]; [transition setSubtype: kCATransitionFromTop]; [[[[modalViewController view] superview] layer] addAnimation: transition forKey: nil]; [[modalViewController view] removeFromSuperview]; [modalViewController release]; // all done, we can let this go. } @end </code></pre>
 

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