Reputation: 334
I'm making an application that uses a stopwatch as part of the functionality. One of the components is a button that starts and stops the stopwatch. The button works fine, however the action is only completed once the button is tapped AND released. As of now, you could hold down the button and until you let go, nothing will happen to the timer. How can I change the functionality of the button so it performs the action on first touch as opposed to release? The functionality I'm seeking is that of touchesBegan.
Upvotes: 1
Views: 135
Reputation: 2098
In the storyboard, open the connections inspector for your button, then drag a connection from Touch Down
to your action code. Delete any other connections such as to Touch Up Inside
.
Upvotes: 1