How do I do a Fade/No transition between view controllers

前端 未结 10 749
时光取名叫无心
时光取名叫无心 2020-12-07 08:48

Is it possible to do a fade in and fade out transition between View Controllers in Storyboard. Or without transition.

If it\'s possible, what\'s the code for it?

10条回答
  •  醉梦人生
    2020-12-07 09:12

    What I did was to use Storyboard in Interface Builder, connected the two viewcontroller you need to move to /from and back (hold ctrl and drag click from the origin viewcontroller to destination viewcontroller), and changed the segue properties. I used the following:

    I then used the following:

    [self performSegueWithIdentifier:@"showMovieDetailSegue" sender:self];
    

    when you want to remove it, just call this from the origin viewcontroller:

    [self dismissViewControllerAnimated:YES completion:nil];
    

    Simple and very quick.

提交回复
热议问题