I'm new to SwiftUI. I want to place a floating button on Map, but this needs to move based on bottom presenting sheet. Bottom present sheet height will be dynamic and it will minimise and maximise based on swipe up/down.
Here is the images for your reference:
Here is the sample code:
Map {
Annotation("", coordinate: CLLocationCoordinate2D(latitude: Double(deviceViewModel.currentDevice.lat) ?? 0,
longitude: Double(deviceViewModel.currentDevice.lng) ?? 0)) {
DropPinView(deviceViewModel: deviceViewModel)
}
}
.sheet(isPresented: .constant(true)) {
MapTabSheetView()
.presentationDetents([.fraction(0.1), .fraction(0.3)])
.presentationCornerRadius(32)
.presentationDragIndicator(.automatic)
.presentationBackgroundInteraction(.enabled(upThrough: .fraction(0.3)))
.interactiveDismissDisabled()
}


You can make them a part of the
sheetthen just make the backgroundclear.Here is an example.