Skip to content

AliceVice/Forecastly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Forecastly

Hello everyone 👋. Forecastly is a test project showcasing a SwiftUI weather application.

Functionality

  • The app displays today's weather and a 7-day forecast, showing current temperature, conditions, and location along with daily high/low forecasts.
  • The weather is fetched based on the user's current location. Location permission is requested at launch, and all authorization states are handled with appropriate feedback.
  • The forecast is downloaded using Swift Concurrency (async/await).
  • The app uses the MVVM pattern for clear separation of concerns



OpenMeteo API 🌤

Forecastly uses the OpenMeteo API to fetch real-time weather data and forecasts. It provides detailed weather information such as current conditions, hourly updates, and 7-day forecasts, all in an easy-to-use JSON format — no API key required.



Implementation 🛠️

Stack:

  • SwiftUI: For building the app’s user interface.
  • MVVM Architecture: For clear separation of concerns and maintainable code.
  • Swift Concurrency (async/await): For handling asynchronous network calls and data processing.
  • @Observable / Swift’s New Observation Model: For state management across the app.
  • Core Location: For obtaining the user’s current location and reverse‑geocoding.
  • Open‑Meteo API: To fetch real‑time weather data (daily, hourly, and current conditions).

Project Structure:

Screenshot 2025-03-23 at 12 29 46 PM

Screens:

  • When the user opens the app, he needs to grant location access.
  • If the user has not enabled location access, he will be redirected to a view with instructions on how to do so; this view also includes a button to open the settings.

RequestLocation AllowLocationUse        PermissionDenied

  • An error message appears in case if there was an error while fetching the forecast.

ErrorScreen

  • The HomeView has a navigation bar with two buttons (“info button” and “expand button”) and a sheet view displaying a detailed forecast.
  • You can expand the sheet either by using a drag gesture or by tapping the “expand button” in the top right corner.
  • You can view all of the forecast information by scrolling through the sheet.

HomeViewRecord

  • Tapping the “info button” brings up the Overview screen, which contains links and information about the project and API.

OverviewViewRecord



Notes 🗒️

  • The @Observable mechanism works only with iOS 17, so ensure that the minimum deployment target is set to iOS 17.
  • When you launch the app, you might see the following warning in the console:
    "CoreSVG has logged an error. Set environment variable 'CORESVG_VERBOSE' to learn more."
    This warning is not critical because I have applied .symbolRenderingMode(.multicolor) on system images, but not all of them support multicolor mode.

About

Test project showcasing a SwiftUI weather application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy