I'm writing an app where I've got multiple TableViews. If you click the cell from the first one, it opens a second one with specific parameters. For each one of them I parse some content from a website, which often takes some time. I want my users to know that they have to wait a bit, so I wrote a class where I overlay a progressview while the app is parsing. My problem is, that if I try to start it before parsing and hide it after, it gets hidden before the content is completely parsed.
I tried using threads and grand central dispatch, but it didn't work out.
The last thing I tried was this:
LoadingScreen.shared.showOverlay(self.view)
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
self.parse()
}
LoadingScreen.shared.hideOverlayView()
LoadingScreen.shared.hideOverlayView() is always called too early. Any ideas on how to fix this? :(