iOSアプリケーションでunrecognized selector sent
エラーが発生しました。私は他の同様のスレッドで言及された答えに基づいて問題を解決しようとしましたが、失敗しました。下記のコードを見て、これを手伝ってください。UISwipeGestureRecognizerが認識できないセレクタにエラーを送信しました
おかげ
class ThirdViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let leftSwipe = UISwipeGestureRecognizer(target: self, action: Selector(("HandleSwipes:")))
let rightSwipe = UISwipeGestureRecognizer(target: self, action: Selector(("HandleSwipes:")))
leftSwipe.direction = .left
rightSwipe.direction = .right
view.addGestureRecognizer(leftSwipe)
view.addGestureRecognizer(rightSwipe)
}
func HandleSwipes(sender: UISwipeGestureRecognizer) {
//if(sender.direction == .left)
//{
// tabBarController?.selectedIndex = 1
//}
}
}
スウィフトバージョンのような
callメソッドのようにコールする必要がありますか? –
Swift Version 3.0 – Vyshakh
@Vyshakh - 更新された回答を確認する –