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 :: UICollectionView current visible cell index 
Swift :: connect old iphone with latest xcode 12 or 13 
Swift :: how to add button dynamically in swift 4 
Swift :: Save class in userdefaults ios swift 
Swift :: swift go back to previous view controller 
Swift :: swift close app 
Swift :: swift remove tableview cell 
Swift :: swift ways to setup constraints 
Swift :: swift read file 
Swift :: how to bold text swiftui 
Swift :: dismiss two view controllers at once swift 
Swift :: clone repo using jenkins pipeline 
Swift :: tableview cell animation swift 
Swift :: navigationbar large title swift 
Swift :: create class swift 
Swift :: count down timer swift stack overflow 
Swift :: how to set the stack color in swiftui 
Swift :: swiftui change form section color 
Swift :: how to merge 2 arrays in swift 
Swift :: swiftui textfield focus 
Swift :: How to convert String into Array of character 
Swift :: can you pass an enum as a parameter to a function swift 
Swift :: ios get notification payload 
Swift :: convert nscfstring to dictionary swift 
Swift :: Swift for Loop with where Clause 
Swift :: rotate sfsymbol horizontal flip swiftui 
Swift :: spacing in uitextfield 
Swift :: UISearchController keys 
Swift :: swift concurrency datatask before ios 15 
Swift :: Alamofire upload multiple image with parameters swift 5 site:stackoverflow.com 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =