我使用SwiftLoading:的NSTimer与SwiftLoading
https://www.miniassets.com/news/1-create-loading-with-activity-indicator-in-swift-2-and-xcode-7.html
隐藏它,我用一个NSTimer:
var timer = NSTimer.scheduledTimerWithInterval(4.0, target: self, selector: #selector(ViewController.update), userInfo: nil, repeats: false)
func update()
{
SwiftLoading().hideLoading()
}
功能 “更新()” 的4秒后解雇,还会触发hideLoading()函数,但加载视图保留在屏幕上。
有谁知道,为什么会发生这种情况?
你确定'update'被触发吗?你把断点或检查日志? – Shubhank