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()