ios - dismissViewControllerAnimated not animating ViewController -
i want slide in viewcontroller in screen, , @ point slide out , go presenting viewcontroller. use code mainviewcontroller launch modal, , dismiss it.
why dismiss slide animation not working?
// present react component sliding right on top of current viewcontroller + (void)presentslidingfromright:(uiviewcontroller*)presented onviewcontroller:(uiviewcontroller*)presentervc { catransition *transition = [[catransition alloc] init]; transition.duration = 1; transition.type = kcatransitionpush; transition.subtype = kcatransitionfromright; [presentervc.view.window.layer addanimation:transition forkey:kcatransition]; [presentervc presentviewcontroller:presented animated:no completion:nil]; } // dismiss react component sliding right + (void)dismissslidingtoright:(uiviewcontroller*)presented onviewcontroller:(uiviewcontroller*)presentervc { catransition *transition = [[catransition alloc] init]; transition.duration = 3; transition.type = kcatransitionpush; transition.subtype = kcatransitionfromleft; [presentervc.view.window.layer addanimation:transition forkey:kcatransition]; [presentervc dismissviewcontrolleranimated:no completion:nil]; }
could try changing line:
[presentervc dismissviewcontrolleranimated:no completion:nil];
for one:
[presentervc dismissviewcontrolleranimated:yes completion:nil];
update
make sure calling static functions on main thread
Comments
Post a Comment