How do I pass information between storyboard segues?

后端 未结 1 332
自闭症患者
自闭症患者 2020-12-03 10:51

In the app I\'m creating, one of the features is that users can submit their own quotes to be displayed in the app. There is one storyboard segue that lets the user enter th

相关标签:
1条回答
  • 2020-12-03 11:21

    Use the prepareForSegue:sender: method to pass data from the source to destination view controller:

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        if ([segue.identifier isEqualToString:...]) {
            MyViewController *controller = (MyViewController *)segue.destinationViewController;
            controller.myProperty1 = ...;
            controller.myProperty2 = ...;
        }
    }
    
    0 讨论(0)
提交回复
热议问题