Skip to content

SwiftUI에서 하나의 뷰에서 여러 종류의 Alert를 띄워주려면 어떻게 해야하나요? #82

Discussion options

You must be logged in to vote
@Published var isShowingSheet = false
@Published var isShowingAddEventConfirmationAlert = false
@Published var isShowingAddEventSuccessAlert = false
@Published var isShowingAddEventFailureAlert = false

Button("캘린더에 추가") {
    observed.isShowingAddEventConfirmationAlert = true
}
.alert("'AsyncSwift'이(가) 사용자의 캘린터에 접근하려고 합니다.", isPresented: $observed.isShowingAddEventConfirmationAlert, actions: {
    Button("허용 안 함") { observed.isShowingAddEventConfirmationAlert = false }
    Button("확인") { observed.additionConfirmed() }
}, message: {
    Text("사용자의 '캘린더'에 접근하도록 허용합니다.")
})
.alert("일정 등록 완료", isPresented: $observed.isShowingAddEventSuccessAlert, actions: {
    Button("확인", role: .cancel) { …

Replies: 1 comment

Comment options

M1zz
Sep 14, 2022
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by M1zz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant