在当前日期出示清单

时间:2019-09-08 21:07:06

标签: swiftui

在我的应用中,我具有一个列表视图,其中包含日期数组var calcWeights : [EggDay]

struct EggDay: Identifiable {

    var id : Int
    var date : Date 
    var weight : Double
    var measured : Bool
    var dailyLoss : Double

    init (id : Int, date: Date, weight : Double, measured : Bool, dailyLoss : Double) {
        self.id = id
        self.date = date
        self.weight = weight
        self.measured = measured
        self.dailyLoss = dailyLoss
    }
}

它按日期排列,从第1天开始,如View 1所示。我要实现的是View 2 ...,因此列表应在当天显示。

standard List based on days List based on current date

0 个答案:

没有答案