UIViewController transition - objective-c

前端 未结 4 944
盖世英雄少女心
盖世英雄少女心 2021-01-03 02:36

I have UIViewControllers A and B, they are allocated in AppDelegate. I need to apply transition to them. How to transit them without reallocating a

4条回答
  •  悲&欢浪女
    2021-01-03 03:19

    try

    UIViewController* controller1;
    UIViewController* controller2;
    [controller1 transitionFromViewController:controller1 toViewController:controller2 duration:0.5f options:0 animations:nil completion:nil];
    

    or

    if on top of navigationtroller - controller1 then

    UINavigationController* nav;
    [nav pushViewController:controller2 animated:YES];
    

提交回复
热议问题