V
V
Viktor Paperno2018-03-19 00:19:31
iOS
Viktor Paperno, 2018-03-19 00:19:31

How to execute a function while a key is pressed in Swift?

Task: there is a button, you need to perform a certain action, for example, print a message while it is pressed. That is, they clamped - the execution of the function began, released - the execution is interrupted. How to implement it? Thanks in advance)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iMaximus, 2018-03-19
@iMaximus

It is done in an elementary way, 2 IBActions are created, one starts when the button is pressed, some process starts. The second when wrung out, the process stops.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question