简体   繁体   中英

unwinding segue or forward segue?

I have this configuration of viewControllers and segues on a storyboard.

在此处输入图片说明

Application starts at A. A presents two choices to the user: create a new project or load a new project.

User chooses to create a new project

The user then goest to B and creates stuff, proceeding to Preview to see it rendered. At Preview the user can save the project and can also go forward to file manager to load another project. If the user chooses to go to the file manager, after loading a project the app unwinds the segue to preview. This is the normal flux (black lines).

User chooses to load a project

Another flux is this. The user starts the app at A and chooses to load a project. Then the app goes directly to the file manager where a project can be load. Here is my problem. The app cannot unwind to preview because it jumped from A to file manager, so the app has to go forward to preview. If I do that, the user cannot modify the project, because the part that allows modification is on B (green lines flux). Also, if I go to preview from file manager I will have an inconsistency because at one time the preview's back button will go to B and on another instance to the file manager.

How do I solve that? I cannot go from file manager to B.

I would amend your flow, so that:

a) The File Manager scene seques into Scene B . If you want the user to be taken straight to the Preview scene in this case, then just implement an immediate segue into Preview . Then from the Preview scene you can unwind to Scene B to undertake further edits, etc.

b) When the user saves the project in the Preview scene, don't segue forward to File Manager . Unwind all the way back to Scene A . The user will then be presented with the option of creating another new project (segue straight to Scene B ), or loading an existing one (segue to File Manager ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM