0

I guess this has being asked before, but i couldn't find answer. When i am replacing views, i would like that the first view,will slide from left to right (like a scroll view) . But there is not option for that in the UIViewAnimationOptionTransition

    UIViewController *mainV=[self.storyboard instantiateViewControllerWithIdentifier:@"CallTestView"];
    AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     [UIView transitionFromView:delegate.window.rootViewController.view
                        toView:mainV.view
                      duration:1.75f
                       options:UIViewAnimationOptionTransitionFlipFromLeft
                    completion:^(BOOL finished)
     {
         delegate.window.rootViewController=mainV;


     }];
Curnelious
  • 1
  • 16
  • 76
  • 150

2 Answers2

0

Try this method

[UIView animateWithDuration:0.5
                      delay:0.0
                    options:UIViewAnimationOptionCurveEaseInOut
                 animations:^{



                 }
                 completion:^(BOOL finished){


                 }];
yoshiiiiiiii
  • 953
  • 8
  • 20
0

You can achieve it by following way :

CATransition *transitionAnimation = [CATransition animation];
[transitionAnimation setType:kCATransitionPush];
[transitionAnimation setSubtype:kCATransitionFromRight];
[transitionAnimation setDuration:0.5f];
[transitionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[transitionAnimation setFillMode:kCAFillModeBoth];

[youView.layer addAnimation:transitionAnimation forKey:@"changeTextTransition"];

you can replace or change direction according to your need in setSubType.

Akshay Sunderwani
  • 12,428
  • 8
  • 29
  • 52