写了一个Swift版本的提示HUD 暂时没找到合适的可以用一下

写了一个轻量型的 Swift HUD加载库

Imagem de capa

灰常灰常感谢@地选之猿提出这篇文章代码已经不能使用。这个库是当时学 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

SwiftHUD.show()
SwiftHUD.show("Show 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")
SwiftHUD.show("Show Custom Text In Custom View", view: self.view)
SwiftHUD.show("Show Default Text Loading Style", view: self.view, style: SwiftHUDStyle.Loading)
SwiftHUD.show("Show Default Text Error Style", view: self.view, style: SwiftHUDStyle.Error)
SwiftHUD.show("Show Default Text Success Style", view: self.view, style: SwiftHUDStyle.Success)
SwiftHUD.show("Show Default Text Info Style", view: self.view, style: SwiftHUDStyle.Info)
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

self.hud?.hide()
 self.hud?.hide("Hide Show Text After Dismiss Default ")
self.hud?.hide("Hide Show Text After Dismiss Custom 3 second", after: 3)
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()
            })