我有一个UIView,并且我已经为它添加了点击手势:
let tap = UITapGestureRecognizer(target: self, action: Selector("handleTap:"))
tap.delegate = self
myView.addGesture(tap)
我正试图在测试文件中以编程方式进行调用。
sendActionForEvent
我正在使用这个函数,但它不起作用:
myView.sendActionForEvent(UIEvents.touchUpDown)
出现了未识别的选择器被发送到实例。
我该如何解决这个问题?
imageView.userInteractionEnabled = true
。我曾经因为这个问题卡了很久。 - Josh