Skip to content

Instantly share code, notes, and snippets.

@larsacus
Created September 13, 2011 20:14
Show Gist options
  • Save larsacus/1215008 to your computer and use it in GitHub Desktop.
Save larsacus/1215008 to your computer and use it in GitHub Desktop.
LARSAdController - Create Ad in View with View Controller
- (void)viewWillAppear:(BOOL)animated{
[[LARSAdController sharedManager] addAdContainerToView:[self view] withViewController:self];
[[LARSAdController sharedManager] setGoogleAdPublisherId:myPublisherId]; //change publisher id unless you want me to have your monies
[[LARSAdController sharedManager] layoutBannerViewsForCurrentOrientation:self.interfaceOrientation];
}
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
[[LARSAdController sharedManager] layoutBannerViewsForCurrentOrientation:toInterfaceOrientation];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment