You will be creating a weather app that can update based on the current conditions. You will be parsing JSON that provides current, daily, hourly forecast information for a location.
- Please fork and clone this repository. (It contains a starter project with the storyboard and asset catalog)
- Make a change, commit, and create your Pull Request.
- Push your local changes regularly to Github so they appear on your Pull Request.
- Submit your Pull Request along with your Module Project submission.
- You will be making an app that looks like the Today's Weather screenshot.
- Included in the project is an Asset Catalog with all the weather images you will need for this project.
Your designer sketched out the requirements for the fonts, colors, and spacing on a notepad. They want you to try and match the screenshot as much as possible.
Design Requirements are as follows:
- "Top View" is 40% height of iPhone screen (Use equal height to superview with 0.4 multiplier)
- No white bars on iPhone X style devices
- Edge to edge color (0 point margins)
- Color: System Blue
- "Quick Look" view content inside "Top View"
- Centered vertically and horizontally in "Top View"
- Icon: 64x64 point size
- "City, State" label
- Font: Title 1
- Color: White
- "Summary" label
- Font: Body
- Color: White
- "Temperature" label
- System Light, 60 points
- Color: White
- Icon, "City, State", and "Summary" views should be 0 points vertical spacing
- "Temperature" should be 16 points away from "Summary"
- 60% height of the iPhone screen (fill remaining space below top view)
- Edge to edge color (0 point margins)
- Color: HEX:
0057B6
- Light style Home indicator
- Weather "Details Views"
- Title
- ALL CAPS
- Font: System Footnote
- Color: 80% white (gray)
- Value
- Include appropriate units (mph, º, %, and inHg)
- Font: Title 1
- Color: White
- Spacing
- Inset 20 points horizontally on left/right margins
- Inset 20 points vertically from top of "Bottom View"
- Both Title and Value are leading text layout (left edge)
- Detail Views are 50% screen width (minus the 40 constant from left/right margins)
- Detail Views are equal width
- Title
- You must include a info button (SF Symbol: "info.circle.fill") that can display a Settings Table View Controller in the bottom right corner 2. The "Settings Table View Controller" must have a navigation title: "Settings" (Embed it in a navigation controller) 3. The first cell must display "Today's Weather v.1.0" 4. The second cell must display "Powered by Dark Sky", and it must be take users to the Dark Sky website: https://darksky.net/poweredby/
- The toolbar must be transparent along the bottom of the screen. (See this developer hint)
Parse the data for the weather from a JSON file.
Create model objects to parse the data into the following model objects.
NOTE: Make sure you choose a location for your Simulator if you don't test this on a device, since you won't get a location until you do.
Your team lead created a starter project with the icons, helper files, and location services so that you can focus on the weather.
Review the provided files before you begin.
-
Review the APIs value types (and if they are optional) for the required fields.
-
Parse the "CurrentWeather.json" file and verify it works in your Unit Test.
Create a model object:
LSIWeatherForcast
with a child CurrentForecast objectRequired Fields
time
(unix time)summary
icon
precipProbability
precipIntensity
temperature
apparentTemperature
(Feels like)humidity
pressure
windSpeed
windBearing
uvIndex
-
After parsing the "CurrentWeather.json", update the UI using the model object.
- Use the LSIWeatherIcons.h to load the correct icon (? if missing)
- Use LSICardinalDirections.h to convert wind direction (bearing) from 30º to NE.
- Parse the model in the LSIWeatherViewController.m when you "fetch the weather" (Look for the
TODO:
), tomorrow you'll update this to do the actual weather requests.
-
Parse the "DailyWeather.json" file and verify it works in your Unit Test.
-
Parse each day as an:
LSIDailyForecast
time
(unix time)summary
icon
sunriseTime
sunsetTime
precipProbability
precipIntensity
precipType
("rain", "snow", or "sleet", or nil)temperatureLow
temperatureHigh
apparentTemperature
(Feels like)humidity
pressure
windSpeed
windBearing
uvIndex
-
Parse the "HourlyWeather.json" file and verify it works in your Unit Test
-
Parse each object in the array as an
LSIHourlyForecast
objectRequired Fields
time
(unix time)summary
icon
precipProbability
precipIntensity
precipType
("rain", "snow", or "sleet", or null)temperatureLow
temperatureHigh
apparentTemperature
(Feels like)humidity
pressure
windSpeed
windBearing
uvIndex
-
Some fields are optional and are dependent on values in other fields. Make sure you read the documentation.
-
Parse the "Weather.json" and store the properties
currently
daily
hourly
-
Refactor your logic to update Today's Weather using the "Weather.json"
- Add visibility (miles) and dewPoint and display them with the appropriate units.
- Display the sunrise and sunset times (use icons in Asset Catalog)
- Change the units displayed from Cº to Fº, mph to kph etc. (see API documentation)