Press-and-hold button for “repeat fire”
I have referred to countless other questions about a press-and-hold button but there aren't many related to Swift. I have one function connected to a button using the touchUpInside event: @IBAction func singleFire(sender: AnyObject){ //code } ...and another function that is meant to call the function above repeatedly while the same button is held down, and stop when the button is no longer pressed: @IBAction func speedFire(sender: AnyObject){ button.addTarget(self, action: "buttonDown:", forControlEvents: .TouchDown) button.addTarget(self, action: "buttonUp:", forControlEvents: .TouchUpOutside