Please note - I have checked through SO for an answer to this. Many developers have answered, however I feel I have done what was needed.
I added the -ObjC to the project: Other Linker Flags.
I keep getting this error:
NSInvalidArgumentException', reason: '-[GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance
I have followed Googles steps - step by step as well as watching a number of videos (which are in ObjC) and reading a number of blogs.
I have added all frameworks and even unticked do not copy when adding the GMaps bundle.
Here is my code.
AppDelegate
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
Parse.enableLocalDatastore()
Parse.setApplicationId("ParseKey_eOHadu2GEOBqxvRl8ijKM0PMhq3", clientKey: "ParseKey_yFjq2MWocV3188hOq9MIjhqi5x0Od")
PFFacebookUtils.initializeFacebook()
GMSServices.provideAPIKey("MyKey_Pq9rjt5ZFX_jpB_QF5pEarMdp18_x4")
return true
}
Here is my viewController code
class UserLocationGm: UIViewController , GMSMapViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
var camera = GMSCameraPosition.cameraWithLatitude(-33.86,
longitude: 151.20, zoom: 6)
var mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)
mapView.myLocationEnabled = true
self.view = mapView
var marker = GMSMarker()
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20)
marker.title = "Sydney"
marker.snippet = "Australia"
marker.map = mapView
}
Is something missing? i.e. I'm fairly sure that I am not meant to add a MapKit View to the viewController. Has anyone got any suggestions?
Xcode 6 Google Maps SDK: 1.9.1 Lang: Swift