the app will forcibly go to the home screen
Nope, that’s not a supported app lifecycle in iOS.
I want the app to run in the background
First, please see this excellent summary of issues you need to consider: iOS Background Execution Limits.
After reviewing that information, does your desired behavior align with any of the supported scenarios?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: