soenkegissel / ShowAndHideAdBanner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show and hide AdMob Banner

This is an example of how to dyamically load and place an Google AdMob banner to the bottom of the screen.

  • Programmatic implementation.
  • No overlay of the view on top of bannerView.
  • Detects the connection status and shows and hides the banner accordingly.
  • Uses AdMob SmartBanners. Loads SmartBanners for landscape and portrait depending on the current orientation.

How to get started?

  • Get a copy of this repo.
  • Run pod install to get the deps.
    • Dependencies: Firebase/Core, Firebase/AdMob, ReachabilitySwift
  • Open the ShowAndHideAdBanner.xcworkspace

Things to note

  • Deployment target is iOS 9.3
  • Programming is just a little hobby. This code can be written shorter, safer and more robust. Feel free to request a pull if you improved it.

Demo

  • Hides the banner dynamically on rotaton, loads a new banner for the current orientation. Device rotation

  • If the connection (WiFi and cell) gets lost, the banner will hide. After connect will load a new banner. Device rotation


https://rucksack.dev - Rucksack App Development

About


Languages

Language:Swift 96.7%Language:Ruby 3.3%