Skip to content

Commit

Permalink
chore: Update GlobalState class to be final in MyApp.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
yostane committed Jun 27, 2024
1 parent 7c6f786 commit da5af4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions corrections/SwiftUI-01.swiftpm/MyApp.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftUI

class GlobalState: ObservableObject {
final class GlobalState: ObservableObject {
@Published var score = 0
}

Expand All @@ -9,7 +9,7 @@ struct MyApp01: App {
@StateObject var globalState = GlobalState()
var body: some Scene {
WindowGroup {
ContentView()
ContentView().environmentObject(globalState)
}
}
}

0 comments on commit da5af4f

Please sign in to comment.