I'm trying to add a map using GMSMapView but I'm getting errors when I create an outlet for the view.
The following is the code snippet:
import UIKit
import GoogleMaps
class MapViewController: UIViewController {
@IBOutlet weak var mapVIew: GMSMapView!
@IBOutlet weak var mapCenterPinImage: UIImageView!
@IBOutlet weak var pinImageVerticalConstraint: NSLayoutConstraint!
var searchedTypes = ["bakery", "bar", "cafe", "grocery_or_supermarket", "restaurant"]
let locationManager = CLLocationManager()
override func viewDidLoad() {
super.viewDidLoad()
locationManager.delegate = self
locationManager.requestWhenInUseAuthorization()
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "Types Segue" {
let navigationController = segue.destinationViewController as! UINavigationController
let controller = navigationController.topViewController as! TypesTableViewController
controller.selectedTypes = searchedTypes
controller.delegate = self
}
}
}
I'm getting the following errors at line
@IBOutlet weak var mapVIew: GMSMapView!:
- weak may only be applied to class and class-bound protocol types not <>
- use of undeclared type "GMSMapView"
Please can someone help me out
import GoogleMapson the top of file? - t4nhpt