You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to setup a callout that is roughly 200 x 200 is size. The callout pops up fine size is correct. I used a UIView and set contentView = myUIView.
I need to trigger a function when user press on callout. Instead it will dismiss the callout. As well if there is an annotation under the calloutView, it will select this annotation and show a new callout view.
How would I go about preventing the callout from being dismissed as well as firing a function on touch?
Thanks.
The text was updated successfully, but these errors were encountered:
Are you using the callout view inside Apple's MKMapView? If so, you need to do a bit of work to make touch handling work properly. Take a look at MapKitComparisonController.m towards the bottom, in the included CalloutSamples app.
Following your advice, I have looked through the example again and created a custom subclass of MKMapView. But it still does not seem to work. here is my code for the subclass. I can't seem to get it to work, It crashes as soon as I touch the map.
class mapSub : MKMapView {
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer!, shouldReceiveTouch touch: UITouch!) -> CBool {
println(touch.view)
if touch.view .isKindOfClass(UIControl) {
println("no dice")
return false
}
else {
println("make it so Geordie")
return true
}
}
override func hitTest(point: CGPoint, withEvent e: UIEvent?) -> UIView? {
if let cM:UIView = self.hitTest(calloutView.convertPoint(point, fromView: self), withEvent: e)
{
println("direct hit")
return cM
}
return super.hitTest(point, withEvent: e)
}
}
Hi,
I am trying to setup a callout that is roughly 200 x 200 is size. The callout pops up fine size is correct. I used a UIView and set contentView = myUIView.
I need to trigger a function when user press on callout. Instead it will dismiss the callout. As well if there is an annotation under the calloutView, it will select this annotation and show a new callout view.
How would I go about preventing the callout from being dismissed as well as firing a function on touch?
Thanks.
The text was updated successfully, but these errors were encountered: