基本上,当我想将数据从源 View 传递到目标 View 时,我使用“prepareForSegue”方法并使destinationView 等于segue 的destinationView。
但是,如果我想在下面的代码中使用 Storyboard ID 来呈现我当前 View 的上方:
MyCustomViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"MyViewController"];
[self presentViewController:vc animated:YES completion:nil];
如何使用 Storyboard ID 将数据从当前 View 传递到目标 View ?
最佳答案
同样的方法..
MyCustomViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"MyViewController"];
vc.someProperty = something; //use your data here
[self presentViewController:vc animated:YES completion:nil];
关于ios - 当我使用 Storyboard id 时如何将数据传递到目标 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34606978/