I have two questions --
1) How can I prevent a modal from being dismissed when the app enters the background?
2) I have a modal I'm presenting that gets dismissed seemingly at random if it's displayed within the first several seconds of app launch but stays displayed indefinitely otherwise. No other code is calling dismiss, and none of the UIAdaptivePresentationControllerDelegate dismissal methods get called. What other actions / etc would cause a modal presentation to be dismissed like that?
Post
Replies
Boosts
Views
Activity
I have a couple different SwiftUI modal sheets -- one presented in a HostingController from a UIViewController, another presented with .sheet from a SwiftUI view -- that dismiss the moment the app begins to enter the background. I've verified it's not a model issue (even when I set the isPresented variable to true and never modify it, it is still changed somehow to false). It seems to be something the system is doing when the application enters the background. Is this some sort of expected behavior, or how can I prevent it?
I have a UIKit tabbar view that contains three views, one of which is a UIViewControllerRepresentable wrapper around a UIKit view controller. Everything works fine except when that wrapped view is visible, the tab bar icons for the other two views disappear. Tapping within their bounds still works to select those views as expected, and they’re even visible in screenshots and in the debug view of the view hierarchy (they also display normally when running the iPad version of the app on Mac), so I’m not sure where to turn except perhaps a bug report. Is this a known issue when running UIKit views within a SwiftUI TabBar or where should I look next?