如何解决重叠视图的问题?
在我的应用程序中,有一个显示动画的函数:
func showAnimation() {
let animatedViewController = AnimationViewController(name: "")
animatedViewController.modalPresentationStyle = .overFullScreen
animatedViewController.modalTransitionStyle = .crossDissolve
self.present(animatedViewController, animated: true, completion: nil)
}
当应用程序在ViewDidload中启动时,启动了动画功能(ShowAnimation)和数据加载功能。问题在于,如果数据失败了数据,则应出现警报或全屏,但此时仍将显示动画。视图未显示,并且发生错误:
[演示]尝试在(uitabbarcontroller)上介绍(someviewController)(来自myApp.mainviewController),而演示正在进行。
我该如何修复?
In my application there is a function showing animation:
func showAnimation() {
let animatedViewController = AnimationViewController(name: "")
animatedViewController.modalPresentationStyle = .overFullScreen
animatedViewController.modalTransitionStyle = .crossDissolve
self.present(animatedViewController, animated: true, completion: nil)
}
When the application starts in viewdidload, the animation function (showAnimation) and the data loading function are launched. The problem is that in case of unsuccessful loading of data, an alert or a full screen with an error should appear, but at this point the animation still continues to be shown. View is not displayed and an error occurs:
[Presentation] Attempt to present (SomeViewController) on (UITabBarController) (from MyApp.MainViewController) while a presentation is in progress.
how can i fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有了一点了解,我以这种方式解决了问题:
我的错误显示了函数 -
With a little understanding, I solved the problem in this way:
There is my error showing func -