I'm studying Swift and am struggling to figure out how to integrate the Google Map SDK frameworks. I created a new project in Xcode 6, imported the frameworks required as per Google Map SDK instructions for iOS.
However when I import the Google Maps framework using (import )to the AppDelegate.swift file the framework isn't recognised.
Can't find a solution anywhere. Please help.
After you imported Google Maps iOS SDK, you need to have a bridge header defined, then the SDK will be recognized.
To create this bridge header, add an arbitrary Objective-C file(eg: a .m
file) to your project. Xcode will prompt to ask you if to configure a bridge header for you.
Click Yes to continue.
A file ending with -Bridging-Header.h
will be added to your project.
Simply add #import <GoogleMaps/GoogleMaps.h>
in the bridge header, and you are good to go!
Also, it's safe to delete that temporary Objective-C file now.
You can now install SDK via CocoaPods, and you wont need to add the Bridging Header. View this tutorial(Google Maps iOS SDK Link) and just add the following code to your AppDelegate's didFinichLaunchingWithOptions function.
GMSServices.provideAPIKey("API_KEY")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With