Skip to content

Instantly share code, notes, and snippets.

@ChrisRisner
Last active December 11, 2015 03:19
Show Gist options
  • Save ChrisRisner/4536746 to your computer and use it in GitHub Desktop.
Save ChrisRisner/4536746 to your computer and use it in GitHub Desktop.
iOS Day 29
- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave
{
return YES;
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
}
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet ADBannerView *banner;
@end
#import <UIKit/UIKit.h>
#import <iAd/iAd.h>
@interface ViewController : UIViewController <ADBannerViewDelegate>
@property (weak, nonatomic) IBOutlet ADBannerView *banner;
@end
- (void) viewDidLayoutSubviews {
if (self.banner.bannerLoaded) {
CGRect contentFrame = self.view.bounds;
CGRect bannerFrame = self.banner.frame;
contentFrame.size.height -= self.banner.frame.size.height;
bannerFrame.origin.y = contentFrame.size.height;
self.banner.frame = bannerFrame;
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.banner.delegate = self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment