【发布时间】:2016-07-19 20:25:16
【问题描述】:
I have an NStimer in my AppDelegate,when the interval of time chosen has passed the application needs to present a viewcontroller modally from the selector's timer in the AppDelegate.Is it possible to do that ?
【问题讨论】:
-
你为什么要在 appdelegate 中这样做?
-
因为应用程序有多个视图,如果用户不在设置定时器的视图中,我需要定时器不会被破坏
-
你有计时器是什么意思?无论视图有多长,视图都不会被破坏。编辑您的问题以显示您的故事板。
-
我没有说视图被破坏,但我说如果用户不在设置定时器的视图控制器中,定时器将不起作用。我需要计时器来处理所有视图控制器
-
所以有一个视图控制器的主视图,并在其中添加一个计时器。然后做任何你需要做的事情,并根据你的逻辑呈现你想要的特定视图。据了解,AppDelegate 只能显示您想要的根视图,但不能以模态方式呈现。
标签: swift uiviewcontroller presentmodalviewcontroller