ios - Performing an action when 2 buttons pressed at the same time -


is there way code within swift whenever 2 buttons pressed simultaneously, action occurs? can create action links within swift individual buttons when they're pressed i'm not sure how create new action when both buttons pressed.

you can use state machine keep state of both buttons.

both buttons can linked single touchdowninside. each time button triggers method, increment state.
similarly, both buttons can linked single touchupinside. each time button triggers method, decrement state.

finally, in touchdowninside, check if state 2 (when both buttons pressed). means both buttons pressed simultaneously.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -