Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Do you want to change the transition style or do use a switch statement or both? And by scroll do you mean cover vertical?</p> <p>to change the transition style go: .m</p> <pre><code>#import "nextpage.h" @implementation myproject -(IBAction)transition:(id)sender { nextpage *first = [[nextpage alloc]initWithNibName:nil bundle:nil]; first.modaltransitionstyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:first animated:YES]; } </code></pre> <p>You can replace the </p> <pre><code>UIModalTransitionStyleFlipHorizontal </code></pre> <p>with</p> <pre><code>UIModalTransitionStylePartialCurl </code></pre> <p>and </p> <pre><code>UIModalTransitionStyleCoverVertical //default transition style </code></pre> <p>and</p> <pre><code>UIModalTransitionStyleCrossDissolve </code></pre> <p>If you want a switch statement switching between transitions it takes a bit more effort... in this case, each button will have a different tag (0, 1, 2, 3) and they are all connected to one action in IB. This is simply because the switch statement won't let you make variables inside it. .h</p> <pre><code>#import "myfile" @interface myproject UIViewController { myfile *first; } -(IBAction)myaction:(id)sender; </code></pre> <p>.m</p> <pre><code>#import "myfile" @implementation myproject -(IBAction)myaction:(id)sender { switch ([sender tag]) case 0: first = [[myfile alloc]initWithNibName:nil bundle:nil]; first.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:first animated:YES]; break; case 1: first = [[myfile alloc]initWithNibName:nil bundle:nil]; first.modalTransitionStyle = UIModalTransitionStylePartialCurl; [self presentModalViewController:first animated:YES]; break; case 2: first = [[myfile alloc]initWithNibName:nil bundle:nil]; first.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:first animated:YES]; break; case 0: first = [[myfile alloc]initWithNibName:nil bundle:nil]; first.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:first animated:YES]; break; default: break; } </code></pre> <p>switch statement only (please don't call me sir, I am younger than you think!)) .m -(IBAction)myaction:(id)sender { switch ([sender tag]) case 1: //what you want done break; case 2; //what you want done when the sender tag's tag is two break; //and so on... default: break; }</p> <p>an IBAction is simply an action that appears in the actions section in Interface Builder (IB= Interface Builder) the IBAction is used as an action that can be edited in the .m file to do virtually anything. If this is not the answer you wanted please make a comment on this answer.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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