I'm building my first real iOS application. In my app I'm using REFrostedViewController (https://github.com/romaonthego/REFrostedViewController), which uses three viewcontrollers to construct a slideout menu; a rootviewcontroller, a homeviewcontroller and a rootviewcontroller.
Before the rootviewcontroller, I've created a login screen. If the login is successful, a token is send back from the server. This token is needed for further requests to the server. The app then performs a segue
called login_success
. Now, normally I'd send the token to the rootviewcontroller with something along the lines of this:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"login_success"]) {
RootViewController *controller = (RootViewController *)segue.destinationViewController;
controller.xAuthToken = _xAuthToken;
}
}
However, I can't use this to send it to multiple viewcontrollers. How can I do that?