我使用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