This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import CoreLocation | |
import MapKit | |
//記得要import CoreLocation跟Mapkit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import GoogleMobileAds | |
class TableViewController: UIViewController, UITableViewDelegate, GADBannerViewDelegate { | |
var bannerView: GADBannerView? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
//adSize有多種選擇,可以去官方文件裡面參考,這邊用的是iphone直立使用的size | |
bannerView = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait) | |
//下面這邊unitID,請填如你自己的,或是官方給的測試ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
#先取得該檔案夾內所有的檔案名稱 | |
def get_list(): | |
all_name = os.listdir() | |
return all_name | |
n = 11 | |
cafeIndex = '2342' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import googlemaps | |
import os | |
google_key = "AIzaSyCLfZQjoR4uuH3-gikZOf01XLltl_bSlxx" | |
gmaps = googlemaps.Client(key = google_key) | |
#前面一樣要先取得google key,還有設定client | |
#下面這邊,我假設妳已經取得了10個photo_reference,並且將他們存在list裡面 |
OlderNewer