I have already accomplished a single tap recognizer but can not figure out how to make that single tap recognizer a double tap instead. I could use some guidance.
Code:
import Foundation
import UIKit
class MainBoardController: UIViewController{
let tap = UITapGestureRecognizer()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
var swipe: UISwipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: "GotoProfile")
swipe.direction = UISwipeGestureRecognizerDirection.Right
self.view.addGestureRecognizer(swipe)
tap.addTarget(self, action: "GotoCamera")
view.userInteractionEnabled = true
view.addGestureRecognizer(tap)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func GotoProfile(){
self.performSegueWithIdentifier("Profilesegue", sender: nil)
}
func GotoCamera(){
self.performSegueWithIdentifier("Camerasegue", sender: nil)
}
}
tap.numberOfTapsRequired = 2
UITapGestureRecognizer
for taps, notUISwipeGestureRecognizer
. Unless you mean two-finger swipe and not double-tap.