Hi! environment is xcode 12.2/Catalina (10.15.7), and I'm trying to get pins to drop on the map at the start of the project (and nothing happens)
Some background: I haven't had to get a developer account - the error and capabilities requirement mentioned on page 254 ("enabling maps") didn't generate an error, and the map renders fine.
Using my relatively amateur debugging skills, it looks like the NSGestureRecognizer registers agains the view fine:
override func viewDidLoad() {
super.viewDidLoad()
let recognizer = NSGestureRecognizer(target: self, action: #selector(mapClicked))
mapView.addGestureRecognizer(recognizer)
}
but no gesture is ever recognised (it never calls mapClicked)
@objc func mapClicked(recognizer: NSClickGestureRecognizer) {
debugPrint(recognizer)
let location = recognizer.location(in: mapView)
let coordinates = mapView.convert(location, toCoordinateFrom: mapView)
addPin(at: coordinates)
}
Any thought on whether Is this related to signing/the maps capability? (I wasn't going to spend £79 to find out, but I guess I'm going to need an account at some point :) update: did it, looks like the capabilities UI has changed, but figured out how to add it (plus sign on the top left) and the capability is now listed in the entitlements - still doesn't trigger mapClicked
Is there a more effective way to debug NSGestureRecognizer?