Skip to content

Instantly share code, notes, and snippets.

View MichaelBarney's full-sized avatar
🤖

Michael Barney MichaelBarney

🤖
View GitHub Profile
@MichaelBarney
MichaelBarney / SwiftUI_Ad_Interstitial.swift
Created October 22, 2019 12:15
A google AdMob Interstitial implementation in SwiftUI
import SwiftUI
import GoogleMobileAds
import UIKit
final class Interstitial:NSObject, GADInterstitialDelegate{
var interstitial:GADInterstitial = GADInterstitial(adUnitID: interstitialID)
override init() {
super.init()
LoadInterstitial()
@MichaelBarney
MichaelBarney / SwiftUI_Ad_Banner.swift
Last active March 15, 2022 03:45
A google AdMob Banner implementation in SwiftUI
import SwiftUI
import GoogleMobileAds
import UIKit
final private class BannerVC: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
let view = GADBannerView(adSize: kGADAdSizeBanner)
let viewController = UIViewController()