I have a grid of UIButtons and I'd like to call a haptic effect for the following methods:
Any suggestions for how to call a haptic effect when the user moves over a button for the first time?
button.addTarget(self, action: #selector(tap), for: .touchUpInside)
button.addTarget(self, action: #selector(moveOver), for: .??)
func moveOver(sender:UIButton) -> Bool {
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.impactOccurred()
return true
}
The correct UIEventAction to use in this case is touchDragInside