Have a look at the following article: https://www.massicotte.org/isolation-intuition about Swift Isolation Intuition.
Perhaps it will help you understand where Swift runs your code.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: