在 Swift 3 的 SVProgressHUD 中面临非常罕见的问题
检查 pod 文件,如 github 上的 SVProgressHUD 所述,我没有做错任何事情。
您编写代码的方式是在以下代码格式中快速使用objective-c
import UIKit
import SVProgressHUD
class SubViewsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
SVProgressHUD.show()
Timer.scheduledTimer(timeInterval: 5, target: self, selector: #selector(self.update), userInfo: nil, repeats: true)
//With Dispatch Queue
DispatchQueue.global(qos: .userInitiated).async {
SVProgressHUD.show()
// Bounce back to the main thread to update the UI
DispatchQueue.main.async {
Timer.scheduledTimer(timeInterval: 5, target: self, selector: #selector(self.update), userInfo: nil, repeats: true)
}
}
}
func update() {
SVProgressHUD.dismiss()
}
}
// Install Pods
pod 'SVProgressHUD'
// Import SVProgressHUD in view controller
import SVProgressHUD
// use...