Quick Tip: Integrate iAd banners in your iOS App with two lines of code
The easiest way to add iAD banners to your app
Today I’ll show a very simple way to integrate an ad banner to your iOS app. Most tutorials (including mine) explain the complex way by implementing the ADBannerViewDelegate protocol. If you don’t care about error handling, animations, positioning or the maximum number of allowed banner instances (10!): There is a much easier way which requires only two lines of code in SWIFT to integrate iAD.
For details how to subscribe for the Apple iAds program, please check my previous article about iAD integration.
1. Create the sample project:
2. Ad the iAD framework to your project:
3. Add these two lines of code to your ViewController class:
That’s all for today.