Question

Can you update the UI from a beginBackgroundTaskWithExpirationHandler ? Is it possible to do so using a perofrmSelectorOnMainThread or GCD ?

Was it helpful?

Solution

Are you trying to update the UI from the expiration handler? Because that's where you should be doing this (as it marks the end of the task) and not only can you update the UI but you are SUPPOSED to update the UI from there. To quote the Apple docs:

The handler is called synchronously on the main thread, blocking the app’s suspension momentarily while the app is notified.

Seems pretty clear cut to me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top