From 3ccba2962068504ae5ac1adc958f0327b5028329 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 4 Sep 2025 20:28:56 +0200 Subject: [PATCH] fix: prevent name conflict --- QuizApp/Views/QuizView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QuizApp/Views/QuizView.swift b/QuizApp/Views/QuizView.swift index f9948a8..08aab42 100644 --- a/QuizApp/Views/QuizView.swift +++ b/QuizApp/Views/QuizView.swift @@ -11,7 +11,7 @@ import AudioToolbox struct QuizView: View { @StateObject var quizViewModel = QuizViewModel() - @AppStorage("globalScore") var score: Int = 0 + @AppStorage("globalScore") var globalScore: Int = 0 @Environment(\.dismiss) var dismiss let questions: [QuizQuestion] // Neue Property @@ -29,7 +29,7 @@ struct QuizView: View { ) .onAppear { AudioServicesPlaySystemSound(1322) - score += quizViewModel.score + globalScore += quizViewModel.score // Highscore prüfen/setzen quizViewModel.isNewHighscore = quizViewModel.updateHighscoreIfNeeded() }