ik1
ik1

Reputation: 213

Skobbler SKMapView and UIPanGestureRecognizer

I've got a question about Skobbler MapView and UIPanGestureRecognizer. It seems that UIPanGestureRecognizer intercepts all pan events from SKMapView and blocks from moving map position.

You could see code example below, the only difference between my application that UIPanGestureRecognizer is located in parent view 2 levels above.

import UIKit

class IPSkobblerViewController : UIViewController {

    var mapView : SKMapView!;

    override func viewDidLoad() {
        mapView = SKMapView();
        mapView.exclusiveTouch = true;
        self.view.addSubview(mapView);

        let gestureRecogniser = UIPanGestureRecognizer(target: self, action: "panGesture");
        self.view.addGestureRecognizer(gestureRecogniser);

    }

    func panGesture() {
        NSLog("Pan Gesture");
    }

}

Upvotes: 1

Views: 158

Answers (2)

Adrian.B
Adrian.B

Reputation: 519

It will be fixed in the 3.0.2 release.

Upvotes: 1

SylviA
SylviA

Reputation: 1577

The first thing to do is set the recogniser's cancelsTouchesInView to false

gestureRecogniser.cancelsTouchesInView = false 

This will enable the gesture recogniser to allow the view it is attached to, to receive touch events. If that view is not the map view, then the touch events have to be forwarded to it.

Upvotes: 1

Related Questions