mercredi 6 mai 2015

Custom Transistion animation shows viewController with a blink

I am working with a custom transition, animation like that of a push. But when i use this code after my viewcontroller loaded after after animation it just blinks.

Here is the method i used to present my view controller

+(void)leftpresentFrom:(UIViewController *)fromviewcontroller
                To:(UIViewController *)toviewcontroller
{

CGPoint newcenter       = CGPointMake(480, toviewcontroller.view.center.y);


toviewcontroller.view.center           =newcenter;


toviewcontroller.view.clipsToBounds=YES;


[fromviewcontroller.view addSubview:toviewcontroller.view];


[UIView animateWithDuration:.5
                      delay:0.0
                    options:UIViewAnimationOptionCurveEaseInOut
                 animations:^{
                     toviewcontroller.view.center = CGPointMake(160 ,toviewcontroller.view.center.y);
                 }
                 completion:^(BOOL finished){
                     [toviewcontroller.view removeFromSuperview];
                     [fromviewcontroller presentViewController:toviewcontroller animated:NO completion:^{

                     }];

                 }];
}

Aucun commentaire:

Enregistrer un commentaire