unwind-segue

Unwind then segue without showing intermediate view controller

时光毁灭记忆、已成空白 提交于 2019-12-01 12:16:08
I have three UIViewControllers where A -> B -> C, and A -> D. When the user is done in C I want to unwind back to A and then segue to D, but I cannot get this to work without briefly showing A before the segue to D happens. I have tried disabling the animates property for the segue but A still flashes into view for less than a second. Any idea as to how I can fix this? Try this Code in swift 3 :- let oldVCs = self.navigationController?.viewControllers var newVCs = [UIViewController]() // Add your root VC in new array of VCs newVCs.append(oldVCs![0]) // Add your new VC just after your root VC

Unwind then segue without showing intermediate view controller

走远了吗. 提交于 2019-12-01 10:56:58
问题 I have three UIViewControllers where A -> B -> C, and A -> D. When the user is done in C I want to unwind back to A and then segue to D, but I cannot get this to work without briefly showing A before the segue to D happens. I have tried disabling the animates property for the segue but A still flashes into view for less than a second. Any idea as to how I can fix this? 回答1: Try this Code in swift 3 :- let oldVCs = self.navigationController?.viewControllers var newVCs = [UIViewController]() //

Unwind segue doesn't work in Swift 3 and iOS 10

不打扰是莪最后的温柔 提交于 2019-11-30 23:51:37
问题 I'm trying to test unwind segue in iOS 10 and Swift 3. I made a simple app like this: I add code for segue in TableViewController class and connect "Cancel" button and Exit on Table View Controller Scene: @IBAction func unwindToRootViewController(segue: UIStoryboardSegue) { print("Unwind to Root View Controller") } but my simple segue doesn't work. What am I doing wrong? 回答1: As can be seen in the comments above the problem was this: I add code for segue in TableViewController class The

(Swift) Unwind segue when multiple view controllers lead to same view?

不羁岁月 提交于 2019-11-30 12:13:00
问题 I am trying to code a hangman game and am having trouble with unwind segues. I have multiple view controllers that all ultimately lead to the same view, where the user plays the actual hangman. However, depending on the presenting controller, I want the game to be in different "modes" (ie: multiplayer, single player, etc.). I am trying to add a play again button that unwinds to the previous view controller, but am unsure how to unwind when there are multiple paths the user could have taken to

How to segue with data from one Tab to another Tab properly

不打扰是莪最后的温柔 提交于 2019-11-30 05:59:53
问题 I have a Tab Bar Controller which is the Initial View Controller, which also has a PFLoginViewController that pups up if a user isn't logged in. The Login/Signup flow works fine. The two tabs are 1. a UICollectionView which I will refer to as IntroVC from now on 2. a UITableView which I will refer to as FeedVC When a user clicks a photo in IntroVC , a Show segue is triggered (via prepareForSegue ) that shows a 3rd screen ( UIView ) which is technically not a tab. I will refer to this as the

(Swift) Unwind segue when multiple view controllers lead to same view?

萝らか妹 提交于 2019-11-30 02:09:20
I am trying to code a hangman game and am having trouble with unwind segues. I have multiple view controllers that all ultimately lead to the same view, where the user plays the actual hangman. However, depending on the presenting controller, I want the game to be in different "modes" (ie: multiplayer, single player, etc.). I am trying to add a play again button that unwinds to the previous view controller, but am unsure how to unwind when there are multiple paths the user could have taken to get to this view. In other words, my app kind of goes: A -> B -> C or A -> D -> C where C can (ideally

How to segue with data from one Tab to another Tab properly

左心房为你撑大大i 提交于 2019-11-28 12:01:48
I have a Tab Bar Controller which is the Initial View Controller, which also has a PFLoginViewController that pups up if a user isn't logged in. The Login/Signup flow works fine. The two tabs are 1. a UICollectionView which I will refer to as IntroVC from now on 2. a UITableView which I will refer to as FeedVC When a user clicks a photo in IntroVC , a Show segue is triggered (via prepareForSegue ) that shows a 3rd screen ( UIView ) which is technically not a tab. I will refer to this as the SelectVC from now on. NOTE: All of these screens are also Embed(ded) In a Navigation Controller. The

How to do something before unwind segue action?

偶尔善良 提交于 2019-11-28 07:35:30
I've just figured out what is an unwind segue and how to use it with the great answers from this question. Thanks a lot. However, here's a question like this: Let's say there is a button in scene B which unwind segues to scene A, and before it segues I want something to be done, such as saving the data to database. I created an action for this button in B.swift, but it seems it goes directly to scene A without taking the action appointed. Anyone knows why or how to do this? Thank you. You can do it the way you describe, or by using a prepareForSegue override function in the viewController you

Perform push segue after an unwind segue

有些话、适合烂在心里 提交于 2019-11-27 19:09:29
问题 I am working on a camera app where the camera views are shown modally. After I am done with cropping. I perform an unwind segue to the MainPageViewController . (Please see the screenshot) My unwind function inside MainPageViewController is as follows; @IBAction func unwindToMainMenu(segue: UIStoryboardSegue) { self.performSegueWithIdentifier("Categories", sender: self) } where "categories" is the push segue identifier from MainPageViewController to CategoriesTableViewController . The program

How to do something before unwind segue action?

放肆的年华 提交于 2019-11-27 01:51:58
问题 I've just figured out what is an unwind segue and how to use it with the great answers from this question. Thanks a lot. However, here's a question like this: Let's say there is a button in scene B which unwind segues to scene A, and before it segues I want something to be done, such as saving the data to database. I created an action for this button in B.swift, but it seems it goes directly to scene A without taking the action appointed. Anyone knows why or how to do this? Thank you. 回答1: