对于点击登陆按钮后,想要添加一个弹窗,提示正在登录。
swift show loading indicator
Study Swift: UIActivityIndicatorView – Show an Activity Indicator Programmatically
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中添加正在登录的提示