Assign a value to a controller property in Swift
问题 I am trying to pass an int variable between views in Swift but I'm not sure how to access the other View controller's property. In Objective C I would do something like this UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; AnsViewController *ansViewController = [storyBoard instantiateViewControllerWithIdentifier:@"ansView"]; ansViewController.num = theNum; [self presentViewController:ansViewController animated:YES completion:nil]; And in the other