【发布时间】:2020-08-25 12:48:09
【问题描述】:
我有一个非常复杂的问题,按钮已经有一个作为@objc 函数的点击动作。我可能必须为 cellForRow 函数实现代码,但它如何仅在这些函数起作用时才调用?
@objc func longPress(gesture: UILongPressGestureRecognizer) {
if gesture.state == UIGestureRecognizer.State.began {
print("Long Press")
//Was trying to figure out how to add segue call here
}
}
func addLongPressGesture(){
let longPress = UILongPressGestureRecognizer(target: self, action: #selector(longPress(gesture:)))
longPress.minimumPressDuration = 0.75
self.expandButton.addGestureRecognizer(longPress)
}
【问题讨论】:
标签: ios swift uitableview button segue