Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UIButton を押したままにして、いくつかのメソッドを繰り返し呼び出す必要があります。ボタンを離したら、そのメソッドの呼び出しを停止する必要があります。この機能を実装するにはどうすればよいですか。これについて考えている人は、この問題から抜け出すのを手伝ってください..事前に感謝します。
method を使用touchesBeganして、このメソッドを呼び出し、このメソッドtouchesEndを停止できます。
touchesBegan
touchesEnd
メソッド内では、いくつかのループforまたはwhile条件に応じてこのメソッドを呼び出すか、タイマーを開始して でこのメソッドを呼び出し、でタイマーをtouchesBegan無効にすることができますtouchesEnd。
for
while