[Solved] How to compare array of dates with greater than current date
i Resolved my issue by using stack overflow suggestions. and i am posting my answer it may helpful for others. extension Date { var startOfWeek: Date? { let gregorian = Calendar(identifier: .gregorian) guard let sunday = gregorian.date(from: gregorian.dateComponents([.yearForWeekOfYear, .weekOfYear], from: self)) else { return nil } return gregorian.date(byAdding: .day, value: 1, to: sunday) } var … Read more