To use location services in an iOS app, we need to add a description to indicate why we want to use the location in the info.plist file. In this app, we only need to get the location when we are using the app, so we only need to add a description for this. Let's set this up:
- Open info.plist in Weather.iOS with the XML (Text) Editor.
- Add the NSLocationWhenInUseUsageDescription key using the following code:
<key>NSLocationWhenInUseUsageDescription</key>
<string>We are using your location to find a forecast for you</string>