में डबल टैप जेस्चर रिकॉग्नाइज़र जोड़ने के लिए मैंने पहले से ही एक टैप पहचानकर्ता पूरा कर लिया है लेकिन यह पता नहीं लगा सकता कि उस एकल टैप पहचानकर्ता को इसके बजाय दो बार टैप कैसे बनाया जाए। मैं कुछ मार्गदर्शन का उपयोग कर सकता था।स्विफ्ट
कोड:
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' – vacawama
का प्रयोग करें, 'UISwipeGestureRecognizer' नहीं। जब तक आप दो अंगुली स्वाइप का मतलब न लें और डबल-टैप न करें। – rmaddy
आप नंबर ले रहे हैं OfTapsRequired = 2, https://iosdevcenters.blogspot.com/2017/05/uitapgesturerecognizer-tutorial-in.html –