Post

Replies

Boosts

Views

Activity

Reply to Following "Meet WeatherKit"- getting async error
Solved the issue: I forgot to include the given code in a struct and initialize the variables. import WeatherKit import CoreLocation struct RequestWeather { let weatherService = WeatherService() let chicago = CLLocation(latitude: 47, longitude: 87.58293) let weather : Weather let temperature : Measurement<UnitTemperature> init() async { weather = try! await weatherService.weather(for: chicago) temperature = weather.currentWeather.temperature } }
Topic: App & System Services SubTopic: General Tags:
May ’23
Reply to Following "Meet WeatherKit"- getting async error
Solved the issue: I forgot to include the given code in a struct and initialize the variables. import WeatherKit import CoreLocation struct RequestWeather { let weatherService = WeatherService() let chicago = CLLocation(latitude: 47, longitude: 87.58293) let weather : Weather let temperature : Measurement<UnitTemperature> init() async { weather = try! await weatherService.weather(for: chicago) temperature = weather.currentWeather.temperature } }
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Use iPhone's Proximity Sensor
I copied this code and ran it on my iPhone 13. The number does not change. I did confirm that my sensor was working by calling someone to see if my screen turns off.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23