skip to Main Content

How to run .task() at least once every hour – Ios swift

In my main view MainView() I load weather data from WeatherKit asynchronously via .task() which runs whenever the user's location changes: .task(id: locationManager.currentLocation){ if let location = locationManager.currentLocation{ weather = try await weatherService.weather(for: location) } } However, the user's location…

VIEW QUESTION
Back To Top
Search