gpt4 book ai didi

ios - 为什么UIProgressView设置进度不会停止?

转载 作者:行者123 更新时间:2023-12-01 21:51:34 31 4
gpt4 key购买 nike

我想在移动到App或Auth VC之前先显示出进度条动画

通过下面的代码,它可以正常工作,但问题只解决了一次(启动应用程序的时间)

那么,问题是停止问题了吗?如果是怎么处理的请?

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(true)


Auth.auth().addStateDidChangeListener { (auth, user) in
if user == nil {
// User Signed out

self.progressive.setProgress(3, animated: true)
// Before calling asyncAfter perform showing loader or anything you want.


DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
// Your code to execute after a delay of 3 seconds.
self.performSegue(withIdentifier: "Auth", sender: nil)
}

} else {
// User Signed In

self.progressive.setProgress(3, animated: true)
// Before calling asyncAfter perform showing loader or anything you want.

self.progressive.setProgress(3, animated: true)

DispatchQueue.main.asyncAfter(deadline: .now() + 3) {

self.performSegue(withIdentifier: "App", sender: nil)
}
}
}
}

最佳答案

不要忘记在某个地方重置progressView:
self.progressive.setProgress(0, animated: false)

关于ios - 为什么UIProgressView设置进度不会停止?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61571295/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com