【发布时间】:2015-02-05 23:53:57
【问题描述】:
我使用动画来指定提示以帮助延迟交互:
let delay = 1.8 * Double(NSEC_PER_SEC)
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue()) {
//call the method which have the steps after delay.
self.rain.alpha = 0
UIView.animateWithDuration(5, animations: {
self.rain.alpha = 1
})
self.tip.startAnimating()
}
但是,如果在动画开始之前,用户触摸了屏幕,我需要停止这个延迟过程。
【问题讨论】: