【发布时间】:2019-01-16 15:45:35
【问题描述】:
我遇到了 UILongPressGestureRecognizer 的问题,我使用了以下代码:-
func addLongPressGesture(){
let lngPr = UILongPressGestureRecognizer.init(target: self, action: #selector(self.handleLongPress(gesture:)))
lngPr.delaysTouchesEnded = true
self.addGestureRecognizer(lngPr)
}
@objc func handleLongPress(gesture:UIGestureRecognizer){
if selectedIndexPath != nil && delegate != nil{
self.delegate?.delegateLongPressed(atIndexPath: selectedIndexPath!)
}
}
【问题讨论】:
标签: ios swift long-press swift4.1 uilongpressgesturerecogni