[英]how to go back while NVActivityIndicatorView is start?
我在我的項目中使用NVActivityIndicatorView
作為微調器。 當我決定回去時,我一直等到錠床工人停下來。 所以我必須在微調器加載時返回。
import UIKit
import NVActivityIndicatorView
import Foundation
class Utilities: UIViewController,NVActivityIndicatorViewable
{
func startprogress()
{
let size = CGSize(width: 30, height: 30)
startAnimating(size, message: nil, type:
NVActivityIndicatorType(rawValue: 12)!)
}
func stopprogress() {
self.stopAnimating()
}
}
在我的視圖控制器中:
override func viewDidLoad() {
super.viewDidLoad()
Utilities().startprogress()
apiMethod()
}
在我的回復成功后,我停止了活動指標
func apiMethod()
{
let onSuccess: ((_: NSDictionary) -> Void)? = {(_ response: NSDictionary) -> Void in
print(response)
Utilities().stopprogress()
}
在這里,我面臨的問題是我必須等到指標停止回去。
您正在主UIWindow上應用activityIndicator
。 你必須只在特定的UIViewController
上添加activityIndicator
。 如果您需要任何幫助,請參閱以下鏈接。
https://github.com/ninjaprox/NVActivityIndicatorView/issues/191 https://github.com/ninjaprox/NVActivityIndicatorView/issues/174 NVActivityIndicatorView僅適用於特定視圖
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.