【SwiftUI】モーダルを画面を閉じる方法(dismiss)

struct SubView: View {
    @Environment(\.presentationMode) var presentationMode
   
    var body: some View {
        Button(action: { 
            didTapDismissButton()
        }) {
        }
    }
  
    private func didTapDismissButton() {
        presentationMode.wrappedValue.dismiss()
    }
}