This can be done using completion handler. As soon as it gets the data, the data can be sent to the UI using the main thread (DispatchQueue.main.async{}).
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags: