Call to main actor-isolated instance method XXX in a synchronous nonisolated context
This is bug in current swift versions as compiler is not able to recognize the global actor context for a defer block, the discussion for this is going on swift forum and a PR with fix also available that should resolve this issue in future swift versions. For now, explicitly global actor context need to … Read more