-2

Facing very rare issue in SVProgressHUD in Swift 3

Error of SVProgressHUD in Swift 3

Check the pod file i didn't do any thing wrong as mentioned on the SVProgressHUD on github.

SVProgressHUD POD file

nathan
  • 9,329
  • 4
  • 37
  • 51
Mohammad Kalim
  • 33
  • 1
  • 2
  • 6

2 Answers2

6

the way you had written code is for objective-c use below code format in swift

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

}
iOS Geek
  • 4,825
  • 1
  • 9
  • 30
0
// Install Pods

pod 'SVProgressHUD'

// Import SVProgressHUD in view controller

import SVProgressHUD


// use...
Hitesh Chauhan
  • 1,520
  • 15
  • 16