confirmationDialog는 하단에서 나타나는 메뉴로 앱에서도 자주 사용되는 컴포넌트입니다

 

 

struct ContentView: View {
    @State var pressed: Bool = false
    
    var body: some View {
        Button {
            pressed.toggle()
        } label: {
            Text("버튼")
        }
        .confirmationDialog("confimationDialog입니다", isPresented: $pressed) {
            Button {
                
            } label: {
                Text("버튼1")
            }
            Button {
                
            } label: {
                Text("버튼2")
            }
            Button {
                
            } label: {
                Text("버튼3")
            }
        }
    }
}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ytw_developer