#OpenWeather
OpenWeather is a minimum viable product (MVP) app that displays the weather in your current location.
User Story: As an outdoor person and traveler, I want to know the day's weather forecast so that I can dress appropriately.
Acceptance Criteria: Can I see today's weather forecast for my current location?
- Determines the user's location once.
- Displays a map of the user's location.
- Makes a single network call to the OpenWeatherMap API to fetch weather information based on the user's location.
- Displays to the user their city's name, current temperature, weather description, and an icon representing the current weather.
- Allows user to switch temperature units between Celsius and Fahrenheit.
- Every time the app enters the background and becomes active again, weather data will be refreshed.
- Test for correct navigation bar title.
- Test for existence of city name.
- Test for existence of weather description.
- Test for proper operation of Celsius/Fahrenheit segmented control.
- Test for generation of weather query url for a given location.
- Test for serialization of response JSON from OpenWeatherMap API to a model object.
- Test for conversion of Kelvin double value to formatted temperature display string in celsius or fahrenheit.
- Test for mapping from OpenWeatherMap API icon name to local icon image name.
- Map is zoomed out to encompass the entire United States.
- Displays the empty weather state.
- Map is zoomed to current location.
- Displays the empty weather state.
- Map is zoomed to current location.
- Weather is displayed for current location.
- Map is still zoomed in to current location.
- Current location indicator disappears.
- Weather is still displayed for current location.
- Current location indicator reappears.
- Map is still zoomed in to current location.
- Weather is still displayed for current location.
- Map is still zoomed in to current location.
- Current location indicator is still showing.
- Weather is still displayed for current location.
The app does not use any third-party dependencies. Weather icons used were taken from the Tropos iOS App.
OpenWeather is written in Swift 3.0 using XCode 8 and the iOS 10 SDK. Since there are no third party dependencies just build and run using XCode.
OpenWeather is a single page app using a single ViewController and Storyboard.
The are two singleton classes. OWLocationManager is a singleton class that handles all requests for the user's current location. OWNetworkManager is a singleton class that handles all network requests to the OpenWeatherMap API.
The delegation pattern is used to notify the ViewController whenever there is new location or weather data from the singleton classes. When a new location is received, the map will zoom to that location and trigger a network call to fetch weather data using OWNetworkManager. Once new weather data is received it will be fed into WeatherInfoView to update display using that data.