Search code examples
iossprite-kitiad

Top screen iAd in Sprite Kit


I just finished my game in Objective-C with the Sprite Kit framework and now I want to put an iAd banner on the top of the screen but I actually have it at the bottom and I don't know how to set it on top.

I use this code in the -viewDidLoad method in the ViewController.m but it appears at the bottom

self.canDisplayBannerAds = YES;

I would thank if someone please can help me how to position the banner on the top of the screen.


Solution

  • Initialize your banner view like this and add it to the view

    ADBannerView *bannerView = [[ADBannerView alloc]initWithAdType:ADAdTypeBanner];
    

    The default position is on the top