swift UISwipeGestureRecognizer和UIPanGestureRecognizer同时使用

时间:2015-01-03 15:32:58

标签: ios swift uigesturerecognizer

    var panGesture = UIPanGestureRecognizer(target: self, action: "pan:");
    var swipeGestureLeft = UISwipeGestureRecognizer(target: self, action: "swipe:");

    swipeGestureLeft.direction = UISwipeGestureRecognizerDirection.Left;

    self.view.addGestureRecognizer(swipeGestureLeft);
    self.view.addGestureRecognizer(panGesture);

当我运行它时,只触发平移手势。如果不将平移手势添加到视图中,则滑动手势的工作方式应该如此。

0 个答案:

没有答案