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
36
votes
7 answers

Perform push segue after an unwind segue

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…
Berkan Ercan
  • 1,187
  • 3
  • 13
  • 31
33
votes
3 answers

Passing data with unwind segue

I created two view controllers. I created a segue from the first to the second to pass data. Now I want to pass data from the second view controller to the first one. I went through many similar questions and I'm not able to implement those as I…
ebby94
  • 2,981
  • 2
  • 20
  • 31
17
votes
3 answers

How to do something before unwind segue action?

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…
Mechanic
  • 173
  • 1
  • 1
  • 5
13
votes
3 answers

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

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…
Jared
  • 538
  • 7
  • 20
12
votes
3 answers

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

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…
SamYoungNY
  • 5,716
  • 4
  • 22
  • 36
11
votes
2 answers

Unwind Segue iOS goes back 1 too many VC's

I have a 3 viewcontroller navigation where A presents modal controller B, which presents modal controller C all via segues. C has an unwind segue back to B. It also has an unwind back to A. When I perform action for C to unwind to B, it unwinds but…
noobsmcgoobs
  • 2,596
  • 5
  • 26
  • 48
10
votes
1 answer

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

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…
IlyaGutnikov
  • 557
  • 1
  • 6
  • 19
7
votes
2 answers

Unwind Segue not dismissing View Controller with UIModalPresentationCustom

I'm presenting a modal view controller using a custom transition (by setting its modelPresentationStyle to UIModalPresentationCustom, providing a transitioning delegate, and UIViewControllerAnimatedTransitioning object). In the presented view…
7
votes
1 answer

ios8 unwind segue not working with UINavigationBarController and UITabBarController (Fixed in iOS 8.1)

I just started testing my iOS7 app on iOS8 with Xcode 6 (beta 6). I am aware that iOS 8 has deprecated the "push" and "modal" segue but I was happy to find that all my segue's worked... except one. I built a demo app to show that unwinding from a…
NSDev
  • 71
  • 5
6
votes
1 answer

When presenting modally over current context, on unwind, viewDidAppear is not getting called

I have an issue with an app I'm developing. XCode version: 9.2 (9C40b) Programming language: Swift 4 Target iOS version for the app: 11.2 Scenario: I have a mainVC (ViewController) which calls a modally presented secondaryVC. After doing a…
Markussen
  • 75
  • 9
6
votes
2 answers

Custom Unwind Segue for iOS 8 and iOS 9

My question is, how do I get the following custom unwind segue to work on a device with a version prior to iOS 9 as well as on a device running iOS 9? I have a Custom Segue showing a view controller, and then have a corresponding Custom Unwind…
Josh Gafni
  • 2,769
  • 2
  • 16
  • 32
6
votes
4 answers

Unwind segue doesn't dismiss adaptive popover presentation when not modal

Update for iOS 9 beta: Apple may have fixed this for iOS 9. If you work(ed) around this issue for iOS 8, make sure it also works correctly on iOS 9. In storyboard, I've created a popover presentation segue to present a navigation and view…
user4151918
5
votes
1 answer

iOS - unwind to my initial view controller

I am using an unwind segue to unwind to the initial view controller in my storyboard. The unwind works great, I implemented this method in my initial view controller: - (IBAction) unwindToInitialViewController:(UIStoryboardSegue *) unwindSegue…
lostintranslation
  • 20,811
  • 42
  • 129
  • 220
4
votes
2 answers

Show UIAlert before unwinding segue

I'm trying to fire an alert that asks if you want to save or delete a draft after pressing cancel. I'm quite close, but I can't seem to get it right. I'm unwinding from 'ReplyMailViewController'(ViewController A) to…
Jérémy
  • 363
  • 1
  • 2
  • 19
4
votes
3 answers

Having problems with Xcode 8.1 and unwind segues

I can't get unwind segue to work with the latest Xcode 8.1 GM. I'm just wondering if I'm the only one, or someone else is experiencing the same. I have set up the view-controllers as before, it worked in Xcode 8.0, but now I'm having no luck.…
GJ Nilsen
  • 685
  • 8
  • 26
1
2 3
20 21