I have a screen with 6 buttons. All the buttons are connected to one IBAction
. They are tagged and I use a switch statement to determine which one was tapped.
How can I add a Long and Tap gesture to each button? So for example when I tap button 1 it know if its a long gesture or a tap gesture?
So if I tap the button will do something different then when I long press.
Thanks.
@IBAction func playPauseAudioButton(sender: UIButton) {
switch sender.tag {
case 1:
//Tap Gesture
//Long Gesture
//I need this for every button
print("1")
case 2:
print("2")
case 3:
print("3")
case 4:
case 5:
print("5")
case 6:
print("6")
default:
print("Default")
}
}