更新时间:2021-12-11 22:16:20
意识到我可以更改代码的结构:
Realized I could just change the structure of the code:
loadData()
if error {
log.error("Error")
} else {
processData()
}
DispatchQueue.main.asyncAfter(deadline: delay) { //Delay = now + 0-2 seconds
updateUI()
cleanup()
}