Skip to content

codeswift27/weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Weather

About

Weather is a simple weather app. You can use it to get to get the weather wherever you're at, or you get weather forecasts for other locations. (Shout out to Tommorrow.io (ClimaCell) and their amazing API for all of the weather data!) To get quick and easy weather forecasts for you and your friends, try out Weather!

Upon opening the app, you will receive a popup requesting access to your general locations. I was able to implement this through the LocationManager class and the Info.plist file. After the popup, you will be select among three tabs—Home, Saved, and Search—hosted by the ContentView:

  • The first tab is Home. This view gets your current location (or a location you can manually set in settings) and passes it into another view, WeatherDetails, which fetches the weather data from Tomorrow.io. When the data is loaded, the view displays, showing the current weather.

  • The second tab, Saved, lists your saved locations (empty by default) along with their temperatures and weather conditions, all stored in LocationCards. You can add locations to saved locations by searching for them in the Search tab and tapping the star icon on the top right corner, and you can remove them by simply swiping left on them in the Saved tab. You can also tap on these locations to view the weather in those areas.

  • Finally, the last tab, Search, allows you to search for new locations and star them to add them to your saved locations. I used Apple's MKLocalSearchCompleter API to show relevant locations as you search. I also created an ObservableObject class to store a list of CLPlacemarks for your saved locations, allowing the app to quickly update its view when a location is added or removed, and preloading placemarks to load views faster and lower usage of Apple's geocoding API.

This app was quite a handful and definitely ended being a lot harder and took much longer than I initially thought it would. However, it was definitely worth it in the end and despite the many setbacks, it was very fun to create! Throughout the process, I redesigned the app, found inspiration from other weather apps (shoutout to CARROT Weather and the new iOS 15 weather app), and learned about new frameworks, libraries, and even hacky workarounds to implement my app. I’m very proud of how my app turned out and I hope to improve it in the future. Until then, I hope you enjoy Weather! :)

Demo

Video: https://youtu.be/xHRDuXmyzKs

Sources

About

App that predicts the weather 🌧

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages