Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift swipe gesture

override func viewDidLoad() {
    super.viewDidLoad()
        
    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)
}
Comment

using swipe gesture recognizer swift

@IBAction func swipeHandler(_ gestureRecognizer : UISwipeGestureRecognizer) {
    if gestureRecognizer.state == .ended {
        // Perform action.
    }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: swift thread.sleep 
Swift :: swiftui rectangle color 
Swift :: how to dismiss keyboard in swift 
Swift :: swift do while 
Swift :: swift qrcode scanner 
Swift :: swift webview load html 
Swift :: an in swift 
Swift :: change the title of a button using Swift 
Swift :: make preivew in dark mode swiftui 
Swift :: struct vs enum swift 
Swift :: Module compiled with Swift 5.3 cannot be imported by the Swift 5.3.1 compiler 
Swift :: loop backwards swift 
Swift :: count down timer swift stack overflow 
Swift :: wkwebview load delegate in swift 
Swift :: swift get slected row data in tableview cell 
Swift :: rounded ios button 
Swift :: socket io swift 
Swift :: ios UIButton change image 
Swift :: swift extension Array with element 
Swift :: uilabel center text programmatically swift 
Swift :: button swift ui 
Swift :: Swift Expressions 
Swift :: bold world in text swift 
Swift :: swift ns_enum generic name 
Swift :: swift - salesforce chat only 
Swift :: swift looping through array 
Swift :: function parameters swift 
Swift :: Swift Labeled Statement with break 
Swift :: Swift Syntax of Nested Function 
Swift :: swift increment for loop by 2 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =