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 be provided for code to compile:

defer { Task { @MainActor in dismiss(animated: true) } }

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)