-2

在 Swift 3 的 SVProgressHUD 中面临非常罕见的问题

Swift 3 中的 SVProgressHUD 错误

检查 pod 文件,如 github 上的 SVProgressHUD 所述,我没有做错任何事情。

SVProgressHUD POD 文件

4

2 回答 2

6

您编写代码的方式是在以下代码格式中快速使用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()
    }

}
于 2017-08-10T05:15:06.503 回答
0
// Install Pods

pod 'SVProgressHUD'

// Import SVProgressHUD in view controller

import SVProgressHUD


// use...
于 2018-05-18T15:48:40.777 回答