Restore view state without animating segue

落花浮王杯 提交于 2019-12-13 15:26:54

问题


I have added state restoration to my app, and it seems to work fine, however I'm not happy with the way that it functions.

Basically, the app is a Disney wait time tracker, so it has a selection of the four parks when you first open the app. Tapping on one of these parks segues (with the slide up animation) to the main section of the app. The problem is - When the app is reopened and the view restores after a few seconds, the slide up segue is performed (which is quite distracting).

Anyone have any idea why that is happening?


回答1:


It might be down to how you are triggering your view and what time of segue you are choosing.

Otherwise you can specify whether its animated in your segue method:

ObjectiveC

[self.navigationController pushViewController:aYourViewController animated:NO]

or in Swift:

self.navigationController?.pushViewController(yourController, animated: false)


来源:https://stackoverflow.com/questions/32831715/restore-view-state-without-animating-segue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!