Skip to content

Instantly share code, notes, and snippets.

@colinfwren
Created November 19, 2023 21:15
Show Gist options
  • Save colinfwren/194ab23495e7296ec9ce11cb2730c964 to your computer and use it in GitHub Desktop.
Save colinfwren/194ab23495e7296ec9ce11cb2730c964 to your computer and use it in GitHub Desktop.
Date Test Generic SwiftData Model
import Foundation
import SwiftData
@Model
final class ApproachModel {
var title: String
var shownInYear: Bool = true
var shownInMonth: Bool = true
var shownInWeek: Bool = true
var shownInDay: Bool = true
// implementation specific properties
init(title: String, shownInYear: Bool, shownInMonth: Bool, shownInWeek: Bool, shownInDay: Bool) {
self.title = title
self.shownInYear = shownInYear
self.shownInMonth = shownInMonth
self.shownInWeek = shownInWeek
self.shownInDay = shownInDay
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment