ios widget showing what is available at chucks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: add non isolated

+10 -10
+10 -10
Shared/ChucksShared.swift
··· 13 13 public let url: String 14 14 public let alt: String 15 15 16 - public init(url: String, alt: String) { 16 + public nonisolated init(url: String, alt: String) { 17 17 self.url = url 18 18 self.alt = alt 19 19 } ··· 23 23 public let name: String 24 24 public let allergens: [Allergen] 25 25 26 - public nonisolated var id: Int { hashValue } 26 + public nonisolated var id: String { "\(name)-\(allergens.map { $0.alt }.joined())" } 27 27 28 - public init(name: String, allergens: [Allergen]) { 28 + public nonisolated init(name: String, allergens: [Allergen]) { 29 29 self.name = name 30 30 self.allergens = allergens 31 31 } ··· 37 37 public let slot: String 38 38 public let items: [MenuItem] 39 39 40 - public nonisolated var id: Int { hashValue } 40 + public nonisolated var id: String { "\(venue)-\(slot)-\(meal ?? "")" } 41 41 42 - public init(venue: String, meal: String?, slot: String, items: [MenuItem]) { 42 + public nonisolated init(venue: String, meal: String?, slot: String, items: [MenuItem]) { 43 43 self.venue = venue 44 44 self.meal = meal 45 45 self.slot = slot ··· 98 98 public nonisolated var startMinutes: Int { startHour * 60 + startMinute } 99 99 public nonisolated var endMinutes: Int { endHour * 60 + endMinute } 100 100 101 - public init(phase: MealPhase, startHour: Int, startMinute: Int, endHour: Int, endMinute: Int) { 101 + public nonisolated init(phase: MealPhase, startHour: Int, startMinute: Int, endHour: Int, endMinute: Int) { 102 102 self.phase = phase 103 103 self.startHour = startHour 104 104 self.startMinute = startMinute ··· 108 108 109 109 // Mon-Fri: Hot Breakfast 7-8:15, Continental 8:15-9:30, Lunch 10:30-2:30, Dinner 4:30-7:30 110 110 // Treating Hot + Continental as one "Breakfast" period for simplicity 111 - public static let weekdaySchedule: [MealSchedule] = [ 111 + public nonisolated static let weekdaySchedule: [MealSchedule] = [ 112 112 MealSchedule(phase: .breakfast, startHour: 7, startMinute: 0, endHour: 9, endMinute: 30), 113 113 MealSchedule(phase: .lunch, startHour: 10, startMinute: 30, endHour: 14, endMinute: 30), 114 114 MealSchedule(phase: .dinner, startHour: 16, startMinute: 30, endHour: 19, endMinute: 30) 115 115 ] 116 116 117 117 // Saturday: Continental 8-9, Lunch 11-1, Dinner 4:30-6:30 118 - public static let saturdaySchedule: [MealSchedule] = [ 118 + public nonisolated static let saturdaySchedule: [MealSchedule] = [ 119 119 MealSchedule(phase: .breakfast, startHour: 8, startMinute: 0, endHour: 9, endMinute: 0), 120 120 MealSchedule(phase: .lunch, startHour: 11, startMinute: 0, endHour: 13, endMinute: 0), 121 121 MealSchedule(phase: .dinner, startHour: 16, startMinute: 30, endHour: 18, endMinute: 30) 122 122 ] 123 123 124 124 // Sunday: Hot Breakfast 8-9, Lunch 11:30-2, Dinner 5-7:30 125 - public static let sundaySchedule: [MealSchedule] = [ 125 + public nonisolated static let sundaySchedule: [MealSchedule] = [ 126 126 MealSchedule(phase: .breakfast, startHour: 8, startMinute: 0, endHour: 9, endMinute: 0), 127 127 MealSchedule(phase: .lunch, startHour: 11, startMinute: 30, endHour: 14, endMinute: 0), 128 128 MealSchedule(phase: .dinner, startHour: 17, startMinute: 0, endHour: 19, endMinute: 30) ··· 157 157 public let isOpen: Bool 158 158 public let currentMealEnd: Date? 159 159 160 - public init(currentPhase: MealPhase, timeRemaining: TimeInterval?, nextPhase: MealPhase?, nextPhaseStart: Date?, isOpen: Bool, currentMealEnd: Date?) { 160 + public nonisolated init(currentPhase: MealPhase, timeRemaining: TimeInterval?, nextPhase: MealPhase?, nextPhaseStart: Date?, isOpen: Bool, currentMealEnd: Date?) { 161 161 self.currentPhase = currentPhase 162 162 self.timeRemaining = timeRemaining 163 163 self.nextPhase = nextPhase