I have a method with a completion that collects a data in the background. How do I use this data in the main thread before it finishes its execution?
That is, the main thread launches a method in the background and must wait to collect a data of this method before finishing.