Questions tagged [unwind-segue]

Unwind segues give a way to "unwind" the navigation stack back through push, modal, popover, and other types of segues. use unwind segues to "go back" one or more steps in navigation hierarchy. Unlike a normal segue, which create a new instance of their destination view controller and transitions to it, an unwind segue transitions to an existing view controller in navigation hierarchy. use these callbacks to pass data between the view controllers.

312 questions
1
vote
1 answer

UnwindSegue from View Controller containing a TableView back to Root View Controller

How can I successfully unwind back to my Root View Controller? I am trying to use a button/nav bar item to return to previous Controller. I've seen a solution to use something like... self.tabBarController?.selectedIndex = 1 but I sadly could not…
1
vote
2 answers

Determine when unwind segue animation is completed

I have a custom dismiss animation that uses UIPercentDrivenInteractiveTransition and UIViewControllerAnimatedTransitioning. It is initiated by an unwind segue and the transitioning delegate is set up in prepareForSegue:. In my presenting view…
Daniel Larsson
  • 6,278
  • 5
  • 44
  • 82
1
vote
1 answer

Unwind method doesn't work when using default backward button

I have three view controllers like below I wrote the unwind method in viewcontroller1, and try to receive some data from viewcontroller2 and viewcontroller3 when they unwind to viewcontroller1. @IBAction func unwindToViewController1(segue:…
Patroclus
  • 1,163
  • 13
  • 31
1
vote
1 answer

Cannot use unwind segue defined in Objective-C used in Swift

I have a modal view controller that's inside a navigation controller that I present from diffent controllers and based on diferrent contexts it should return to a diffrent controllers. Basically, whoever implements the segue identifer should…
Cyupa
  • 1,126
  • 13
  • 37
1
vote
1 answer

Swift: unwind segue doesn't work

I'm stuck with unwind segue that doesn't work for some reason, I do everything as described in tutorial: cntrl drag to exit and select unwind action from another controller (please see gif attached). When I run it on my iphone and tap Cancel,…
Elena Rubilova
  • 367
  • 4
  • 16
1
vote
1 answer

How to use unwind(for: UIStoryboardSegue, towardsViewController: UIViewController) in Swift 3?

I use Apple Sample Code. Originally the method looked like this @IBAction func doneTapped() { favoriteCreatureDidChange?(favoriteCreature) dismiss(animated: true, completion: nil) } I changed Segue Kind from Present Modally to Show (e.g.…
Anna
  • 23
  • 6
1
vote
0 answers

Unwind from OverCurrentContext modal presentation doesn't work

I am having a problem similar to this: Cannot Get Unwind Segue Working with Modal View Controller Presented Over Current Context I presented a VC modally using OverCurrentContext presentation style following a tutorial. All set in storyboard. VC1 ->…
sylvia
  • 65
  • 5
1
vote
0 answers

iOS Swift3 unwind segue to view which is not in stack

unwind segue requires the view to be already initiated. Now the view i need to unwind segue to is sometimes skipped. Is there a way to check if the unwind segue will work and if not, perform a normal segue to it?
Jochen Österreicher
  • 683
  • 2
  • 11
  • 25
1
vote
1 answer

Where could I find the source code of UIStoryboardSegue.swift

I've been struggling to find examples to implement custom unwind segues that would work with Xcode 10 and Swift 3. I thought looking into the source code would give me a clue. Unfortunately, I don't even know where to find it (searched my macbook…
ikel
  • 518
  • 2
  • 6
  • 27
1
vote
2 answers

Why is my unwind segue crashing my app?

I am trying to create an unwind segue that takes me back two viewControllers, and I thought I had everything set up correctly, but it crashes with no error printed when I perform the segue... Here's what I've done: In the DESTINATION viewController,…
Cody Lucas
  • 682
  • 1
  • 6
  • 23
1
vote
7 answers

Get out of navigation controller and go back to Tab Bar View

So I have this Storyboard. And this is the code when you click the save button. @IBAction func addGroupAction(_ sender: Any) { self.name = groupNameTextField.text! //show spinner progress dialog self.hud.textLabel.text = "Loading..." …
Chris Mikkelsen
  • 3,987
  • 9
  • 29
  • 41
1
vote
1 answer

Unwind of custom segue not triggered

Problem My problem is that unwind process is not triggered even though back button is clicked. My code I have a class 1stViewController that uses a custom segue to 2ndViewController. The custom segue is the following: override func perform() { …
1
vote
0 answers

Unwind Animation - Duplicate View Behind Dismissed View

Extremely strange problem here: When unwinding from VC3 to VC1, VC3 animates down and behind it is VC3! Then that goes away and I'm back to VC1. It all happens in about 1 second, but it's clearly a duplicate. Anyone know why? I'd be less surprised…
Dave G
  • 12,042
  • 7
  • 57
  • 83
1
vote
1 answer

Unwind segue interferring with a show segue

Background into what I am trying to achieve: MainViewController presents TableVC. I will tap on a cell to present a DetailVC. With the ability to dismiss by a doneBarButton on the navigation bars on either TableVC or DetailVC. All doneBarButton's…
lifewithelliott
  • 1,012
  • 2
  • 16
  • 35
1
vote
1 answer

Swift - Unwind segue passes back nil value?

I have two view controllers. The second view controller hosts a table view with a custom cell that unwinds back to the first view controller and sends back the data associated with that cell. In the second view controller class I implemented…
lifewithelliott
  • 1,012
  • 2
  • 16
  • 35