28 lines
701 B
Swift
28 lines
701 B
Swift
import Foundation
|
||
|
||
/// 一个打卡习惯(对应 Android 端 Habit)。
|
||
public struct Habit: Identifiable, Hashable, Sendable {
|
||
public let id: String
|
||
public let title: String
|
||
/// 备注 / 目标描述。
|
||
public let detail: String
|
||
/// 今日是否已打卡。
|
||
public let isCheckedInToday: Bool
|
||
/// 连续打卡天数。
|
||
public let streakDays: Int
|
||
|
||
public init(
|
||
id: String,
|
||
title: String,
|
||
detail: String,
|
||
isCheckedInToday: Bool,
|
||
streakDays: Int
|
||
) {
|
||
self.id = id
|
||
self.title = title
|
||
self.detail = detail
|
||
self.isCheckedInToday = isCheckedInToday
|
||
self.streakDays = streakDays
|
||
}
|
||
}
|