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

前端 未结 6 381
臣服心动
臣服心动 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:23

    Add the function prepareForSeque in the controller being closed.

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

    This function is called before the unwind segue is called (in your example you called it quitQuiz). As you can see, it also has a sender parameter so that you can find out who called the unwind and collect the relevant data accordingly.

    For example of the WWDC 407 video, if you clicked the reset button you would not set the accountInfo and if you clicked the done button you would.

提交回复
热议问题