كما هو الحال في العمل والطباعة في وحدة التحكم.
class ViewControllerTableViewCell: UITableViewCell, UIContextMenuInteractionDelegate {
@IBOutlet weak var like: UIButton!
func initButton() {
let longPress = UILongPressGestureRecognizer(target: self, action: #selector(didLongPress))
like.addGestureRecognizer(longPress)
}
@objc func didLongPress() {
// show image
print("ppppp")
}
.. }
class homepage: UITableViewController, CLLocationManagerDelegate{
var like: UIButton!
..}
في الوقت الحالي ، إذا ضغطت لفترة طويلة ، فسيتم معاملتها كطباعة عادية ولا تطبع أي شيء