Update settings UI from a background closure
In my settings UI I make a http request to a service and based on the results I want to update the settings UI.
I'm developing on a Mac using Swift.
httpRequest("http://example.com") { result in
// change some settings UI values
callback(.refresh, nil)
}
This does not work, so I tried to put the refresh on the main thread like so:
httpRequest("http://example.com") { result in
// change some settings UI values
DispatchQueue.main.async {
callback(.refresh, nil)
}
}
But this does not work either.
Any ideas on how to get this to work?
1
Please sign in to leave a comment.
Comments
0 comments