灰常灰常感谢@地选之猿提出这篇文章代码已经不能使用。这个库是当时学 Swift 才写的已经属于 Swift2.0代码,现在已经修复完成。
因为之前的邮箱不能使用了 现在只好该名称 SwiftHUD->ZSwiftHUD
Github地址

Preview

111.gif

Install

  1. Down This Demo,Dray SwiftHUD File to your project

  2. use Cocoapods

 pod 'ZSwiftHUD'

Show

  • Show Default Text
SwiftHUD.show()
  • Show Custom Text
SwiftHUD.show("Show Custom Text")
  • Show Long Lenght Custom Text
SwiftHUD.show("Show Long Lenght Custom Text,Show Long Lenght Custom Text,Show Long Lenght Custom Text,Show Long Lenght Custom Text,Show Long Lenght Custom Text")
  • Show Custom Text In Custom View
SwiftHUD.show("Show Custom Text In Custom View", view: self.view)
  • Show Default Text Loading Style
SwiftHUD.show("Show Default Text Loading Style", view: self.view, style: SwiftHUDStyle.Loading)
  • Show Default Text Error Style
SwiftHUD.show("Show Default Text Error Style", view: self.view, style: SwiftHUDStyle.Error)
  • Show Default Text Success Style
SwiftHUD.show("Show Default Text Success Style", view: self.view, style: SwiftHUDStyle.Success)
  • Show Default Text Info Style
SwiftHUD.show("Show Default Text Info Style", view: self.view, style: SwiftHUDStyle.Info)
  • Show Default Text After Dismiss Complete
SwiftHUD.show("Show Default Text After Complete", view: self.view, style: SwiftHUDStyle.None, after: 2, complete: { (hud) in
                UIAlertView(title: "This is Alert", message: nil, delegate: nil, cancelButtonTitle: "OK").show()

            })

Hide

  • Hide No Text
self.hud?.hide()
  • Hide Show Text After Dismiss Default
 self.hud?.hide("Hide Show Text After Dismiss Default ")
  • Hide Show Text After Dismiss Custom 3 second
self.hud?.hide("Hide Show Text After Dismiss Custom 3 second", after: 3)
  • Hide Show Text After Dismiss Custom 3 second After Complete
self.hud?.hide("Hide Show Text After Dismiss Custom 3 second After Complete", after: 3, complete: { (hud) in
                UIAlertView(title: "This is Alert", message: nil, delegate: nil, cancelButtonTitle: "OK").show()
            })