When I run the app in the simulator, all I get is a white window at the bottom of the screen which is where I placed the banner but then it disappears after 3 seconds...
This is the code I have in my .h
file for iad:
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "CardScrollView.h"
#import <iAd/iAd.h>
@interface ViewController1 : UIViewController <CardScrollViewDelegate,
ADBannerViewDelegate> {
}
@property (weak, nonatomic) IBOutlet ADBannerView *banner1;
@end
This is the code I have in my .m file for iad:
- (void)viewDidLoad
{
[super viewDidLoad];
self.banner1.delegate = self;
}
- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner
willLeaveApplication:(BOOL)willLeave
{
return YES;
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:1];
[UIView commitAnimations];
}
- (void)bannerView:(ADBannerView *)banner
didFailToReceiveAdWithError:(NSError *)error {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations];
}
@end
Note: I have two delegates in the .h
file as shown above because I also have an UIScrollView
on that same view controller. I don't have any errors or warnings so why isn't it showing up? This code works in my other apps.