iOS PresentViewControlle后,直接返回根视图

在开发中:用[self presentViewController:VC animated:YES completion:nil];实现跳转,多次跳转后,直接返回第一个。

例如:

A presentViewController B
B presentViewController C
C 直接回到A:

返回第一个视图核心代码如下:

[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
原文地址:https://www.cnblogs.com/jukaiit/p/5088661.html