GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

How to prevent app from going into background state

Forums > SwiftUI

I've noticed that my app goes into the background state when the device locks. When the user than unlocks their device they are presented back with the home screen (both on iOS and iPadOS). Is this the expected behavior on ios 17.5 or is there something I need to do with SwiftUI to prevent this from happening?

   

Hacking with Swift is sponsored by Alex.

SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!

Try for free!

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.