更新时间:2022-12-09 11:02:03
好的-找到了答案.需要将其放置在不同的线程中,该线程允许UI在执行完线程功能后立即进行更新:
Okay - found the answer. It needs to be placed inside a different thread that allows the UI to update as soon as execution of thread function complete :
DispatchQueue.main.async {
// Update UI
}
dispatch_async(dispatch_get_main_queue(){
// code here
})
dispatch_async(dispatch_get_main_queue(), ^{
// code here
});