I have a simple app which does some probability calculations. I have a plus button which increments a label value 0.1% at a time. What I want to do is increment it faster if I hold down the plus button. All the code I've searched for is for older versions of Swift or Xcode and I can't get my head around how to do it!
At the moment, I have returned to a functioning app with an @IBAction
func called plusButton
which just adds 0.1% to a label @IBOutlet
called preAssessmentProbability
.
I would be most grateful if anyone could help with telling me how to keep this functionality but add the ability to hold down the plusButton
to increment the preAssessmentProbability
label more rapidly (bonus gratitude if you can help with telling me how to set the rate of this).