8

I am new to Iphone SDK.i am using following code.but the animation happens from Right to Left when i click this button.i want to do fro botton to Up

- (IBAction)clickedsButton:(id)sender
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationDuration:0.75];
    [self.navigationController pushViewController:settingsController animated:TRUE];
    [UIView commitAnimations];
}

setAnimationTransition supports only Two ... 1)UIViewAnimationTransitionFlipFromLeft 2) UIViewAnimationTransitionFlipFromRight.. any help please? i used following, but it is not working

settingsController.modalTransitionStyle =  UIModalTransitionStyleCoverVertical;
[self.navigationController pushViewController:settingsController animated:YES];
Toby Allen
  • 10,562
  • 10
  • 70
  • 120
senthilMuthu
  • 9,258
  • 18
  • 74
  • 139

2 Answers2

5

What you're looking for is

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated;
Jasarien
  • 57,071
  • 27
  • 154
  • 186
  • 2
    i want to do that,through PUSHVIEWCONTROLLER only.because i had used popviewcontroller in that next view controller(settingsController) will presentModalViewController support popviewcontroller.... – senthilMuthu Oct 24 '09 at 12:21
  • 3
    the opposite to presentModalViewController:animated: is dismissModalViewController:animated: – Jasarien Oct 24 '09 at 12:43
  • It is an Apple intention that popViewController is animated from right to left. It enforces user interaction design, and you should be following Apple's Human Interface Guidelines. The animation from bottom to top is for modal views. – Jasarien Oct 24 '09 at 12:45
  • 1
    I'm not wrong. Everything I said was 100% correct. Just because you CAN do something, doesn't mean you SHOULD. Either way, congrats on finding a solution. – Jasarien Mar 10 '10 at 09:43
0

SWIFT 3

self.present(newViewController, animated: true, completion: nil)
MANISH PATHAK
  • 2,425
  • 3
  • 24
  • 28