SwiftUI: Bottom sheet from the iPhone "find my" and "maps" app

I would like to include the bottom sheet from the iPhone "find my" and "maps" app in my app. During my research I came across the new modifier .presentationDetents for sheets. The only problem here is that you can no longer interact with the main screen when the sheet is active. In my app, however, I would like the sheet to be active all the time like in the iPhone apps mentioned and that you can still interact with the main screen like in the iPhone apps with the map. I would be very happy about help. Greetings

Add a Comment

Accepted Reply

This is currently a limitation with the new API. I have already filed feedback and I suggest you do too.

  • Interesting! Ok I will also submit feedback

  • Can you please post the Feedback ID?

Add a Comment

Replies

This is currently a limitation with the new API. I have already filed feedback and I suggest you do too.

  • Interesting! Ok I will also submit feedback

  • Can you please post the Feedback ID?

Add a Comment

I would be interested to find out how you worked around this for the time being? Another issue apart from interactivity I am observing is that you cannot place the sheet using .presentationDetents behind the TabView's tabItem - in my tests it is always place above the whole tabView's tabbar so I cannot replicate the design used in Maps or Find My apps...

Did you get any solution??

Add a Comment

With iOS 16.4 you now can by using the new presentationBackgroundInteraction(_:) modifier.

For your case you can apply this to your presented view:

.presentationBackgroundInteraction(.enabled)
Add a Comment

.presentationBackgroundInteraction(.enabled) worked for my case. Basically the mapView is interactive while a modal or BottomSheet is visible

If you are using a TabBar and want to present the sheet behind the tab bar item using detents you can not do it. The sheet is always presented in front of the tab bar items hiding them