答案 0 :(得分:3)
您编写代码的方式是使用swift
中的代码格式下的Objective-cimport 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()
}
}
答案 1 :(得分:0)
// Install Pods
pod 'SVProgressHUD'
// Import SVProgressHUD in view controller
import SVProgressHUD
// use...