iOS 6 - can i return data when i unwind a segue?

前端 未结 6 399
臣服心动
臣服心动 2020-12-05 03:09

I have created a simple unwind segue using the storyboard tools. I have created the following event handler in the view I want to unwind to:

-(IBAction)quitQ         


        
6条回答
  •  不思量自难忘°
    2020-12-05 03:37

    Thanks Jeff. After watching WWDC video 407 I have a clear solution.

    In the view controller that is the target of the unwind you should create a method that takes a single UIStoryboardSegue parameter and returns an IBAction. The UIStoryboardSegue has a method to return the source view controller! Here is the example taken from the video (credit to Apple).

    - (IBAction)done:(UIStoryboardSegue *)segue {
        ConfirmationViewController *cc = [segue sourceViewController];
        [self setAccountInfo:[cc accountInfo]];
        [self setShowingSuccessView:YES];
    }
    

提交回复
热议问题