How to implement Google AdMobs banner ad in swift?

I want to add an banner advertisement in my tabbed app but I am not able to do it. How exactly can I implement banner adds? This is what I have tried-

import UIKit import GoogleMobileAds  class ViewController: UIViewController {  var banner : GADBannerView!  override func viewDidLoad() {     super.viewDidLoad()     // Do any additional setup after loading the view, typically from a nib.     loadBanner() }  func loadBanner(){     banner = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)     banner.adUnitID = "my_app_id"     banner.rootViewController = self     let req : GADRequest = GADRequest()     banner.loadRequest(req)     banner.frame = CGRectMake(0, view.bounds.height - banner.frame.size.height, banner.frame.size.width, banner.frame.size.height)     self.view.addSubview(banner) } 


Category: ios Time: 2016-07-28 Views: 5

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.206 (s). 12 q(s)