我想使用滑動手勢在標籤欄之間導航。什麼是最簡單的方法來做到這一點?我試過這樣的事情...使用滑動手勢在標籤欄之間導航
import UIKit
class postAdViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
var leftSwipe = UISwipeGestureRecognizer(target: self, action: Selector("handleSwipes:"))
view.addGestureRecognizer(leftSwipe)
}
func handleSwipes(sender:UISwipeGestureRecognizer) {
if (sender.direction == .left) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "favourireviewcontroller") as! UIViewController
self.present(vc, animated: true, completion: nil)
}
if (sender.direction == .right) {
}
}
如果我試圖刷卡沒有任何反應。當向左滑動以下錯誤消息
無法識別的選擇發送到實例應用程序崩潰0x7f924380a730