I've written a code and did an IB action from the main storyboard to the view controller for a swipe gesture action.
@IBAction func swipeToSwitchScheme(_ sender: UISwipeGestureRecognizer) {
if sender.direction == .right{
switchCurrentScheme()
}
else if sender.direction == .left {
print("swiped left")
}
}
However, it seems like it can only detect .right gesture and not left. Is there something wrong with how I execute the gestureRecogniser?
Thanks!
Edit:
@IBAction func swipeToSwitchScheme(_ sender: UISwipeGestureRecognizer) {
if sender.direction == .right {
switchCurrentScheme()
}
}
@IBAction func swipeLeft(_ sender: UISwipeGestureRecognizer) {
if sender.direction == .left {
print("swipe left")
switchCurrentSchemeLeft()
}
}
I got it like this but only the right gesture is recognised