Skip to content

Instantly share code, notes, and snippets.

@mrsidique
Created November 5, 2012 15:39
Show Gist options
  • Select an option

  • Save mrsidique/4017832 to your computer and use it in GitHub Desktop.

Select an option

Save mrsidique/4017832 to your computer and use it in GitHub Desktop.
-(void)swingReceivedNotificationReceived:(NSNotification*)notification
{
if ([[notification name] isEqualToString:@"SwingReceivedNotification"])
{
NSDictionary *notificationDictionary = [notification object];
//set values on all screens
for (int i = 0; i < [self childViewControllers].count; i++) {
MetricsDisplayViewController *viewController = (MetricsDisplayViewController*)[self.childViewControllers objectAtIndex:i];
NSString *viewControllerTitle = [NSString stringWithFormat:@"%@", viewController.title];
viewController.metricLabelValue = [notificationDictionary valueForKey:viewControllerTitle];
}
//immediately update the values on the screen if not in demo mode. Otherwise wait for the progress bar to complete. See updateProgressBar method
if (![[NSUserDefaults standardUserDefaults]boolForKey:@"demoModeEnabled"]) {
[self setLabelValues];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment