I have Xcode 6.3.2 and I have a problem with implementation of ADBannerView on storyboard. Xcode shows all the time a warning:
Frame for "Banner View" will be different at run time.
I added 3 constraints, you can see them below.
All of constraints Center horizontally Bottom space to bottom layout guide = 0 Leading space = 0
How to implement banner correctly?
I can not use "self.canDisplayBannerAds = true" because I also use "bannerViewDidLoadAd" and "didFailToReceiveAdWithError" to resize content and also "bannerViewActionShouldBegin" and "bannerViewActionDidFinish" to pause and start again application activity.
SOLVED!
To add iAd banner using Auto Layout and Size Classes in portrait and landscape but without using
canDisplayBannerAds
first declare bannervar bannerView: ADBannerView!
.Use this to set delegate and add banner to view:
Use following code to let banner rotate with screen and resize screen content
contentView
when iAd loads (bottomConstraint
is a constraint fromcontentView
to bottom):Here you call above code to show and hide banner when loads or failed to load iAd
Now you can use
bannerViewActionShouldBegin
andbannerViewActionDidFinish
to pause and start your app activity. :)