Detecting Pan Gesture End

后端 未结 5 635
萌比男神i
萌比男神i 2020-12-29 01:05

I\'ve got a view and I applied a UIPanGestureRecogniser to this view:

UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:sel         


        
5条回答
  •  旧时难觅i
    2020-12-29 01:48

    Above answers are all correct, this is just an updated one for Swift.

    Swift 3:

    func panGesture(recognizer: UIPanGestureRecognizer) {
        if recognizer.state == .ended {
            // Do what you want
        }
    }
    

提交回复
热议问题