empuje uiviewcontroller a otro viewcontroller con animation desde arriba – abajo

En mi proyecto hay una característica cuando el usuario desliza en la barra superior aparecerá una pantalla con animation de arriba a abajo

Hay dos controller de vista oneviewcontroller.m

- (void)swipe { listViewController *list_obj=[[listViewController alloc] initWithNibName:@"listViewController" bundle:NULL]; UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp; [UIView beginAnimations: nil context: nil]; [UIView setAnimationTransition: trans forView: [self.view window] cache: YES]; [self.navigationController pushViewController:list_obj animated:YES]; [UIView commitAnimations]; } 

Pero esto no da la animation de arriba abajo

Quiero implementar la navigation desde Push: = arriba – abajo Pop: = abajo – arriba

por favor ayúdame gracias

    Puede empujar un controller de vista de arriba a abajo como sigue:

    Obj-C:

     - (void) pushVC:(UIViewController )dstVC { CATransition transition = [CATransition animation]; transition.duration = 0.5; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromTop; [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; [self pushViewController:dstVC animated:NO]; } 

    Use el código a continuación para mostrar el controller desde abajo hacia arriba:

     - (void) popVC { CATransition transition = [CATransition animation]; transition.duration = 0.5; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionFade; transition.subtype = kCATransitionFromBottom; [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; [self popViewControllerAnimated:NO]; } 

    Swift 3:

      func open() { let settingsVC = SettingsVC() let transition = CATransition() transition.duration = 0.5 transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) transition.type = kCATransitionPush; transition.subtype = kCATransitionFromTop; navigationController?.view.layer.add(transition, forKey: kCATransition) navigationController?.pushViewController(settingsVC, animated: false) } func close() { let transition = CATransition() transition.duration = 0.5 transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) transition.type = kCATransitionFade transition.subtype = kCATransitionFromBottom navigationController?.view.layer.add(transition, forKey:kCATransition) let _ = navigationController?.popViewController(animated: false) }