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

2018-08-31 16:11:51 浏览数 (1)

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

Preview

111.gif

Install

  1. Down This Demo,Dray SwiftHUD File to your project
  2. use Cocoapods
代码语言:javascript复制
 pod 'ZSwiftHUD'

Show

  • Show Default Text
代码语言:javascript复制
SwiftHUD.show()
  • Show Custom Text
代码语言:javascript复制
SwiftHUD.show("Show Custom Text")
  • Show Long Lenght Custom Text
代码语言:javascript复制
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
代码语言:javascript复制
SwiftHUD.show("Show Custom Text In Custom View", view: self.view)
  • Show Default Text Loading Style
代码语言:javascript复制
SwiftHUD.show("Show Default Text Loading Style", view: self.view, style: SwiftHUDStyle.Loading)
  • Show Default Text Error Style
代码语言:javascript复制
SwiftHUD.show("Show Default Text Error Style", view: self.view, style: SwiftHUDStyle.Error)
  • Show Default Text Success Style
代码语言:javascript复制
SwiftHUD.show("Show Default Text Success Style", view: self.view, style: SwiftHUDStyle.Success)
  • Show Default Text Info Style
代码语言:javascript复制
SwiftHUD.show("Show Default Text Info Style", view: self.view, style: SwiftHUDStyle.Info)
  • Show Default Text After Dismiss Complete
代码语言:javascript复制
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
代码语言:javascript复制
self.hud?.hide()
  • Hide Show Text After Dismiss Default
代码语言:javascript复制
 self.hud?.hide("Hide Show Text After Dismiss Default ")
  • Hide Show Text After Dismiss Custom 3 second
代码语言:javascript复制
self.hud?.hide("Hide Show Text After Dismiss Custom 3 second", after: 3)
  • Hide Show Text After Dismiss Custom 3 second After Complete
代码语言:javascript复制
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()
            })

0 人点赞