Created
November 19, 2023 21:32
-
-
Save colinfwren/bc7aad4543f1874b2b95e327b65374ad to your computer and use it in GitHub Desktop.
Date Test Approach 3 Data Model
This file contains 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
import Foundation | |
import SwiftData | |
@Model | |
final class ApproachModel { | |
var title: String | |
var date: Date | |
var granularity: DateGranularity | |
var year: Int { | |
Calendar.current.component(.year, from: date) | |
} | |
// rest of implementation | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment