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.
Swift 2でボタンが押されるまで実行を一時停止するにはどうすればよいですか?
-- 実行を一時停止
ボタンが押された場合 == true { x = x +10
-- 実行を継続します }
そうしないと {
多分これらはあなたが探しているものです。ボタンタップでタイマーを起動して無効にすることができます。
var timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: "funcToRun", userInfo: nil, repeats: true) timer.fire() timer.invalidate()