Yes you want to use detached task in this case to get the other task out of the main actor. per Apple documentation unstructured concurrency
To create an unstructured task that’s not part of the current actor, known more specifically as a detached task, call the Task.detached(priority:operation:) class method.