I know how to add this element with HStack
and Rectangle
. But...
How is it called?
Does SwiftUI have this element out of the box?
iOS16:
It is added automatically if you have more than one detent, so for just one detent you will have to be explicit about the visibility:
yourContentView
.presentationDetents([.medium])
.presentationDragIndicator(.visible)
Drag Indicator
.Proposals have been made on how to emulate this drag indicator in earlier iOS versions.
As a small addition to the great answers of John M. and happymacaron, this comes even closer:
ZStack(alignment: .top) {
// NavigationView
Capsule()
.fill(Color.secondary)
.opacity(0.5)
.frame(width: 35, height: 5)
.padding(6)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With