Drag and drop on exit from viewcontroller not working

I searched for this problem everywhere. I know how the unwind scene works. I have implemented the following code in VC

-(IBAction)returned:(UIStoryboardSegue *)segue {
try.text = @"Returned from Scene 1";
}

But when I go to my B VC (which is VC, I want to return to A VC) and ctrl drag the button to exit below, it will not allow me. And no function appears in the exit option. Has anyone else had this problem or could it help?

+5
source share
4 answers

To set up unwinding, you must

  • Set up two scenes using the standard modal or push segment between them:

    enter image description here

  • Define custom classes for these two scenes as your respective view controllers.

  • Implement the action in the .m controller to view A:

    - (IBAction)unwindToA:(UIStoryboardSegue *)segue
    {
        //returning to A
    }
    
  • segue B control -dragging ( ) B:

    enter image description here

  • , , popover:

    enter image description here

+16

, . , . , Xcode.

, , , , , - .

+1

, viewController. ctrl-drag, . , , .

swift
@IBAction func unwindSegue(unwindSegue:UIStoryboardSegue) 

objC
- (IBAction)unwindSegue:(UIStoryboardSegue *)sender;
+1

@LoPoBo, @hozefam @Van Du Tran

, , . Bar Button Item Action Segue exitexit segue. 20 , . , - . xcode 6.1

0

All Articles