SVProgressHUD在swift 3中发布

时间:2017-08-10 04:43:22

标签: swift svprogresshud

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

Error of SVProgressHUD in Swift 3

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

SVProgressHUD POD file

2 个答案:

答案 0 :(得分:3)

您编写代码的方式是使用swift

中的代码格式下的Objective-c

enter image description here

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()
    }

}

答案 1 :(得分:0)

// Install Pods

pod 'SVProgressHUD'

// Import SVProgressHUD in view controller

import SVProgressHUD


// use...