Ios swift – IOS: Alternative to closure-style to execute code in UI thread
From background thread, when UI needs to be updated, it needs to post to DispatchQueue.main using the async(execute:) function, as shown below: static func executeInUIThread(_ uiThreadFunc: @escaping (Any?) -> Void, _ parms: Any?) { DispatchQueue.main.async { // Update UI uiThreadFunc(parms)…