iOS dismiss到前两级页面

2022-09-22  本文已影响0人  anny_4243
int i =0;
UIViewController *vc =self;
while(vc.presentingViewController!=nil) {
    i++;
    if(i==3) {
        break;
    }
    vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:^{

}];
上一篇 下一篇

猜你喜欢

热点阅读