Skip to content

Instantly share code, notes, and snippets.

import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
print("A viewDidLoad")
}
import googlemaps
import os
google_key = "AIzaSyCLfZQjoR4uuH3-gikZOf01XLltl_bSlxx"
gmaps = googlemaps.Client(key = google_key)
#前面一樣要先取得google key,還有設定client
#下面這邊,我假設妳已經取得了10個photo_reference,並且將他們存在list裡面
import GoogleMobileAds
class AppDelegate:UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//這邊要做的只有兩件事,一個是import GoogleMobileAds
//另一個就是在didFinishLaunchingWithOptions裡面輸入下面這一行
GADMobileAds.configure(withApplicationID: "這邊就是你自己的 app ID ")
return true
}
}
import GoogleMobileAds
class TableViewController: UIViewController, UITableViewDelegate, GADBannerViewDelegate {
var bannerView: GADBannerView?
override func viewDidLoad() {
super.viewDidLoad()
//adSize有多種選擇,可以去官方文件裡面參考,這邊用的是iphone直立使用的size
bannerView = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)
//下面這邊unitID,請填如你自己的,或是官方給的測試ID
import os
#先取得該檔案夾內所有的檔案名稱
def get_list():
all_name = os.listdir()
return all_name
n = 11
cafeIndex = '2342'