Last active
December 11, 2015 03:19
-
-
Save ChrisRisner/4536746 to your computer and use it in GitHub Desktop.
iOS Day 29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface ViewController : UIViewController | |
@property (weak, nonatomic) IBOutlet ADBannerView *banner; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import <iAd/iAd.h> | |
@interface ViewController : UIViewController <ADBannerViewDelegate> | |
@property (weak, nonatomic) IBOutlet ADBannerView *banner; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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