更新:通过下面的"屏幕截图"方法大纲修复.这有效但有更优雅的方式吗?
我如何解除一堆带有动画的模态视图控制器而不在屏幕上闪烁顶部和底部之间的任何呈现的VC?尝试使用动画执行此操作无效.请参阅下面的代码和描述我的问题的内联注释.您可以将此代码复制/粘贴到Xcode中的新项目中,以便亲自查看您是否愿意!
//
// ViewController.m
// MultipleModals
//
#import "ViewController.h"
#import "MyViewController.h"
#import "MyHelper.h"
@interface ViewController ()
@end
@implementation ViewController
static BOOL doAgain = YES; // So when red appears again, we don't endlessly cycle (for testing)
- (void)viewDidAppear:(BOOL)animated
{
// Invoke super
[super viewDidAppear:animated];
// Prevent loop when we dismiss all the way back to red (for testing)
if (doAgain)
{
// Okay here's where the demo code starts...
// PRESENTING a full stack of modals WITHOUT animation WORKS …Run Code Online (Sandbox Code Playgroud)