Write selector like this.
Swift 2.3 or lower.
let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(HandleSwipes(_:)))
let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(HandleSwipes(_:)))
Swift 3
let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(HandleSwipes(sender:)))
let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(HandleSwipes(sender:)))
Note: One suggestion it is batter method name always start with lower case not upper case. So it is batter if you use handleSwipes
instead of HandleSwipes
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…