I'm not entirely familiar with spriteKit, but I think this should work just the same.
In RootViewController.h in viewDidLoad add:
// Note Notification name: you should probably use a constant
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(updateBannerView:)
name:@"kNotificationUpdateBannerView"
object:nil];
Then, still in RootViewController.h add:
- (void) updateBannerView:(NSNotification *)note {
NSDictionary * info = note.userInfo;
BOOL shouldHide = [info[@"shouldHide"]boolValue];
if (shouldHide) {
NSLog(@"shouldHide");
[self hideBannerView];
}
else {
NSLog(@"shouldShow");
[self showBannerView];
}
}
Now, you're all set up. Whenever you want to call it, use this:
BOOL shouldHide = YES; // whether or not to hide
// Update Here!
NSDictionary * dict = [[NSDictionary alloc]initWithObjectsAndKeys:[NSNumber numberWithBool:shouldHide], @"shouldHide", nil];
[[NSNotificationCenter defaultCenter]postNotificationName:@"kNotificationUpdateBannerView" // Better as constant!
object:self
userInfo:dict];
Now, wherever you are in your app, you can hide/show your banner ads!