Попытка заставить работать распознавание тапа на UIView:
@IBOutlet weak var mapView_: GMSMapView!
@IBOutlet weak var viewInfo: UIView!
override func viewDidLoad() {
super.viewDidLoad()
/* MapView inital values & dependencies */
let initialLocation = CLLocationCoordinate2DMake(37.78, -122.41)
let camera = GMSCameraPosition.cameraWithTarget(initialLocation, zoom: 10)
/* Set up MapView */
mapView_.camera = camera
mapView_.myLocationEnabled = true
mapView_.delegate = self
var selfTap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "viewTapped:")
viewInfo.addGestureRecognizer(selfTap)
viewInfo.userInteractionEnabled = true
mapView_.insertSubview(viewInfo, aboveSubview: mapView_)
}
func viewTapped(recognizer: UIGestureRecognizer) -> Void{
NSLog("tapped")
}
Не распознает кран.
Есть идеи ? Спасибо