Modal Indicator

Show a SwiftUI view at the top of the modal to indicator it is draggable.

private var indicator: some View {
    RoundedRectangle(cornerRadius: Constants.radius)
        .fill(Color.secondary)
        .frame(
            width: Constants.indicatorWidth,
            height: Constants.indicatorHeight
    ).onTapGesture {
        self.isOpen.toggle()
    }
}

Referenced from this blog post with the source from here.

Last Updated February 16, 2021