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
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?
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?
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??
-
Unfortunately not
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)
-
Insane!!! Thank you so much.
-
worked in my case
.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
can you solved 2nd image design code in swiftui? if it done, kindly share the design code I am stuck on it,how to display bottom sheet behind my Bottom toolbar items. (https://developer.apple.com/forums/thread/719893)