Post

Replies

Boosts

Views

Activity

Weather forecast one day short
Using WeatherKit I want to get a 5-day forecast starting tomorrow, however, I only get 4 elements in the forecast. What am I missing here? public func updateWeather()async{ guard locationManager.location != nil else {locationManager.updateLocation(); return} if self.needsUpdating{ let startOfToday = Calendar.current.startOfDay(for: Date()) let endOfToday = startOfToday+24*3600 let firstDay:Date = endOfToday+1 let lastDay:Date = firstDay+(5*24*3600) futureWeather = try? await WeatherService.shared.weather(for: locationManager.location!, including: .daily(startDate: firstDay, endDate: lastDay) ) } }
2
0
607
Oct ’23
Structured logging with emoji or objectdescription
When running the code below, only the first entry gets logged. Structured logging seems not to work when there are emoticons or object descriptions in the message. Is this by design? let logger = Logger(subsystem: "TestSystem", category: "TestCategory") logger.log("👍") // Result = 👍 let someEmoji:String = "👎" logger.log("\(someEmoji)") // Result = empty log line let someObjectDescription:String = String(describing:self) logger.log("\(someObjectDescription)") // Result = empty log line
3
0
1.1k
Aug ’23