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

Answered by BabyJ in 722857022

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

Accepted Answer

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

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)

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??

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)

.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

I did everything I can to make the sheet appear from behind of the tab bar. one package I used and it was really awesome that did the job

https://github.com/lucaszischka/BottomSheet/tree/main#BottomSheetPosition

the solution: https://www.youtube.com/watch?v=8Ys83qvnDvE

I've created small package for this use case because SwiftUI .sheet will overlay on bottom TabView.

https://github.com/wojtek717/bottom-sheet

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