Skip to content

Commit

Permalink
[feat] 問題終了のdismissを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
mrs1669 committed May 22, 2024
1 parent eeefabf commit 22c9772
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PrimePickApp/QuizButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct QuizButtonView: View {
@State private var correctQuizNumber: Int = 0
@Binding var quizNumber: Int
@State private var showAlert = false
@Environment(\.dismiss) private var dismiss

var body: some View {
ZStack {
Expand Down Expand Up @@ -80,7 +81,9 @@ struct QuizButtonView: View {
.alert(isPresented: $showAlert) {
Alert(
title: Text("You Score is \(correctQuizNumber) points!"),
dismissButton: .default(Text("OK"))
dismissButton: .default(Text("OK!")) {
dismiss()
}
)
}
}
Expand Down

0 comments on commit 22c9772

Please sign in to comment.