最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

[已解决]swift中添加正在登录的提示

Swift crifan 850浏览 0评论

对于点击登陆按钮后,想要添加一个弹窗,提示正在登录。

swift show loading indicator

Study Swift: UIActivityIndicatorView – Show an Activity Indicator Programmatically

icanzilb/SwiftSpinner: A beautiful activity indicator and modal alert written in Swift (originally developed for http://doodledoodle.io) Using blur effects, translucency, flat and bold design – all iOS 8 latest and greatest

ios8 – How to display an activity indicator with text on iOS 8 with Swift? – Stack Overflow

Activity Indicator Tutorial in iOS8 with Swift – iOScreator

Coderwall | IOS customized activity indicator with Swift

Activity Indicator Tutorial in iOS8 with Swift – iOScreator

之前已经添加了HRToast的库了

去搜:

HRToast

参考:

Rannie/Toast-Swift: Toast view using swift.

代码:

    func showBeingLogin(){
        dispatch_async(dispatch_get_main_queue(), { () -> Void in
            self.view.makeToastActivityWithMessage(message: "正在登录…")
        })
    }
   
    func clearBeingLogin(){
        dispatch_async(dispatch_get_main_queue(), { () -> Void in
            self.view.hideToastActivity()
        })
    }
showBeingLogin()
clearBeingLogin()

然后显示效果出来了,还可以:

转载请注明:在路上 » [已解决]swift中添加正在登录的提示

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
58 queries in 0.256 seconds, using 18.82MB memory