iOS 앱에 구글맵 추가하기
PodFile에 다음 코드를 추가한다
pod 'GoogleMaps', '6.1.0'
pod 'Google-Maps-iOS-Utils', '3.4.0'
Ruby
복사
그 후, 프로젝트 디렉토리에 가서
pod install
Shell
복사
을 해준다.
AppDelegate.swift 파일에
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
GMSServices.provideAPIKey("Your API Key")
return true
}
Swift
복사
입력해주고
VC에서
import GoogleMaps
Swift
복사
import 해주고 사용하면 된다.