Swift async/await – How to run on background thread
I wanted to do some network request and db fetch on a background thread, what is the best practice of doing this with async/await? In the old world, we would use a bg queue, but how do we do the same with async/await?
SwiftUI Error: Call to main actor-isolated initializer ‘init()’ in a synchronous nonisolated context
Sample Code: