代码如下:
saveManager?.store(com, storeUrl: newUrl, success: {
let vc = CheckViewController()
self.present(vc, animated: true, completion: nil)
print("combine success")
}
解析:
因为在闭包中使用了异步函数,导致UI未在主线程刷新,这时候需要将vc的定义和跳转方法写在主线程中:
DispatchQueue.main.async {
let vc = CheckViewController()
self.present(vc, animated: true, completion: nil)
print("combine success")
}