This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public func updateStreak(recentExerciseMinutes: TimeInterval) { | |
@AppStorage("dog.currentStreak") var currentStreak: Int? | |
@AppStorage("dog.goal") var goal: Int? | |
@AppStorage("dog.todaysExercise") var todaysExercise: Int? | |
@AppStorage("dog.awardedDate") var awardedDate: Double? // Date stored as TimeInterval since 1970 | |
@AppStorage("dog.lastExerciseDate") var lastExerciseDate: Double? // Date stored as TimeInterval since 1970 | |
guard todaysExercise != nil else { | |
todaysExercise = 0 | |
return |