将多个视图推入堆栈而不看到中间的视图
我试图在应用程序的多个部分之间切换时给我的应用程序一种持久的感觉。 当他们点击一个图标时,我希望它直接打开到我所在的视图控制器,但是,我需要让视图控制器堆栈保持与他们离开我的应用程序的该部分时相同。
我似乎最早可以呈现另一个视图控制器是在“viewDIDAppear”方法中,这是有问题的,因为用户在我推动每个视图时看到我正在浏览每个视图。
使用 NSOperationQueue 呈现视图控制器会帮助我实现这个结果。最终,我无法让用户看到我逐步完成每个 VC。
I am trying to give my application a feeling of persistance when switching between multiple parts of the application.
When they tap on an icon I want it to open directly to the view controller that I was on however, I need to get the View Controller stack to stay the same as it was when they left that part of my app.
The earliest I can seem to present another view controller is in the "viewDIDAppear" method which is problematic because the user sees me going through each view as I am pushing it.
Would presenting view controllers with a NSOperationQueue help me achieve this result. Ultimately I just can't have the user see me stepping through every VC.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
似乎与将多个视图控制器推送到导航控制器堆栈上的问题重复
依次推动所有控制器,但仅对最后一次推动进行动画处理。
Seems to be duplicate of Problem pushing multiple view controllers onto navigation controller stack
Push all your controllers one after another but animate only the last push.
当你说“堆栈”时,我会问,你想拥有多少个 UIViewCOntrollers ?因为,你会遇到内存问题吗?您有
viewWillAppear
,它发生在viewDidAppear
之前。When you say "stack" I ask, how many UIViewCOntrollers are you thinking on having? Because, you can run into memory problems? You have
viewWillAppear
, that happens beforeviewDidAppear
.您需要在应用程序委托方法中执行此操作,
这就是我通过保存应用程序状态来完成的方法,
然后当用户完全关闭应用程序后打开应用程序时,它会从他们离开的地方启动。
如果您需要有关如何持久化等的更多信息,我可以提供一些示例,尽管它们确实使用导航控制器。
You need to do it in the app delegate method
That's how I have done it with a saving of the app state done in
Then when the user opens the app after fully closing it down it starts up where they left it.
If you need further information on how to persist etc I can provide some examples although they do use a navigation controller.