如何使用performseguewithidentifier
从左向右转换?我想要做的是当用户向右滑动时,页面/视图控制器的转换将从右向左切换,通常它将从左向右滑动。这可能吗?
我的代码:
override func viewDidLoad() {
var swipeRight = UISwipeGestureRecognizer(target: self, action: "respondToSwipeGesture:")
swipeRight.direction = UISwipeGestureRecognizerDirection.Right
self.view.addGestureRecognizer(swipeRight)
}
func respondToSwipeGesture(gesture: UIGestureRecognizer) {
if let swipeGesture = gesture as? UISwipeGestureRecognizer {
switch swipeGesture.direction {
case UISwipeGestureRecognizerDirection.Right:
performSegueWithIdentifier("LeftSegue", sender: self)
println("Swiped right")
default:
break
}
}
}