[![CI Status](http://img.shields.io/travis/Suchon Dumnin/EGGProgressHUD.svg?style=flat)](https://travis-ci.org/Suchon Dumnin/EGGProgressHUD)
EGGProgressHUD works on iOS 8.0+
EGGProgressHUD is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "EGGProgressHUD"
- Add a pod entry for EGGProgressHUD to your Podfile pod 'EGGProgressHUD'
- Install the pod(s) by running pod install.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Progress without BG
let a = EGGProgressHUD()
a.showInView(self.view)
let triggerTime = (Int64(NSEC_PER_SEC) * 5) //5 Sec
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(triggerTime) / Double(NSEC_PER_SEC)) {
a.hide()
}
Progress with BG
let a = EGGProgressHUD()
a.type = EGGProgressHUD.ProgressType.progressWithBG
a.style = EGGProgressHUD.SpinnerStyle.white
a.bgColor = UIColor.gray
a.showInView(self.view)
let triggerTime = (Int64(NSEC_PER_SEC) * 5) //5 Sec
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(triggerTime) / Double(NSEC_PER_SEC)) {
a.hide()
}
Progress view
fileprivate var i = 0.0
fileprivate var timer: Timer!
fileprivate var a: EGGProgressHUD!
override func viewDidDisappear(_ animated: Bool) {
self.timer.invalidate()
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.a = EGGProgressHUD()
self.a.type = EGGProgressHUD.ProgressType.progressView
self.a.bgColor = UIColor.gray
self.a.loadingTextColor = UIColor.white
self.a.showInView(self.view)
self.timer = Timer.scheduledTimer(
timeInterval: 1.0, target: self, selector: #selector(self.updateProgress),
userInfo: nil, repeats: true
)
self.timer.fire()
}
func updateProgress() {
i = i + 0.1
if i > 1.0 {
self.a.setProgress(Float(self.i))
i = 0.1
} else {
self.a.setProgress(Float(self.i))
}
}
Progress image
let a = EGGProgressHUD()
a.type = EGGProgressHUD.ProgressType.progressImage
a.showInView(self.view)
let triggerTime = (Int64(NSEC_PER_SEC) * 5) //5 Sec
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(triggerTime) / Double(NSEC_PER_SEC)) {
}
Suchon Dumnin, mrdumnin@gmail.com
EGGProgressHUD is available under the MIT license. See the LICENSE file for more info.