Restore view state without animating segue

2019-07-18 16:29发布

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条回答
叛逆
2楼-- · 2019-07-18 16:53

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)
查看更多
登录 后发表回答