HUD.showSuccessWithView(self.view, anim: false)
HUD.showSuccess()
HUD.showSuccess("success!")
HUD.show(true, duration: 0.25, delay: 1, content: .LabeledSuccess(title: "title", subtitle: "subtitle"))
HUD.showError()
HUD.showError("error!")
HUD.show(true, duration: 0.25, delay: 1, content: .LabeledError(title: "title", subtitle: "subtitle"))
HUD.show(.Progress)
HUD.show(.SystemActivity)
static func show(anim:Bool, duration: NSTimeInterval,delay: NSTimeInterval,content: HUDContentType)
static func hide(duration: NSTimeInterval, delay:NSTimeInterval, completion: (Bool -> Void)?)
static func flash(content: HUDContentType, delay: NSTimeInterval, completion: (Bool -> Void)?)
// MARK: >>>>>>>>>> flash extension <<<<<<<<<<
extension RXHUDHelperHandle {
static func flash(content: HUDContentType) {
HUD.show(content)
HUD.hide(hud_duration, completion: nil)
}
}
// MARK: >>>>>>>>>> show extension (window) <<<<<<<<<<
extension RXHUDHelperHandle {
static func show(content: HUDContentType)
static func show(delay: NSTimeInterval,content: HUDContentType)
static func showText(text: String)
static func showSuccess()
static func showSuccess(status:String)
static func showError()
static func showError(status:String)
}
// MARK: >>>>>>>>>> show extension (view) <<<<<<<<<<
extension RXHUDHelperHandle {
static func showWithView(view: UIView,content: HUDContentType, anim:Bool)
static func showSuccessWithView(view: UIView, anim:Bool)
static func showSuccessWithView(view: UIView,status:String, anim:Bool)
static func showErrorWithView(view: UIView, anim:Bool)
static func showErrorWithView(view: UIView,status:String, anim:Bool)
static func showWithView(view: UIView,content: HUDContentType)
static func showSuccessWithView(view: UIView)
static func showSuccessWithView(view: UIView,status:String)
static func showErrorWithView(view: UIView)
static func showErrorWithView(view: UIView,status:String)
}
// MARK: >>>>>>>>>> hidden extension <<<<<<<<<<
extension RXHUDHelperHandle {
static func hidden()
static func hide(completion: (Bool -> Void)? = nil)
static func hide(delay:NSTimeInterval, completion: (Bool -> Void)? = nil)
static func hideWithSuccess()
static func hideWithError()
}
# HUD一共有Dark和Light两种风格
RXHUDHelper.sharedHUD.style = .Dark
# 设置HUD的圆角
RXHUDHelper.sharedHUD.hudRadius = 0
# 设置HUD的显示时动画时间
RXHUDHelper.sharedHUD.showDuration = 1
# 设置HUD距离屏幕中心或者view中心的偏移量
RXHUDHelper.sharedHUD.centerOffset = 50
extension RXHUDHelperHandle {
static func show(content: HUDContentType) {
RXHUDHelper.sharedHUD.contentView = HUD.contentView(content)
RXHUDHelper.sharedHUD.show()
}
}
RXProgressHUD是我学习Swift时的一个练习项目,该项目是参考了:PKHUD