Skip to content

irmusyafa/ios-weatherapp-swiftui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

iOS WeatherApp with SwiftUI

Overview

iOS WeatherApp is copy design from Apple Weather App uses Openweathermap API and build with SwiftUI. Feature this app same with apple weather like get current weather & details, get hourly forecast weather and get daily forecast. But detail not fully same because limited feature free plan from Openweathermap API.

Keyword

  • SwiftUI
  • JSON & Codable
  • MVVM
  • ObservableObject

Getting Started

Prerequisites

  • A valid API key from Openweathermap
  • A Mac running macOS Catalina
  • Xcode 11.3.1

Installation

  1. Clone or download the project to your local machine
  2. Open the project in Xcode
  3. Replace YOURAPIKEY with your valid Openweathermap API key in OpenweathermapAPIClient.swift
class OpenweathermapClient {

    ```
    private let apiKey = "YOURAPIKEY"
  1. Replace cityId with your city want to use in WeatherViewModel.swift you can download list city json in here
class WeatherViewModel: ObservableObject {

    ```
    private let cityId = "1627459"
  1. Run the simulator

Thanks to

Apple amazing library SwiftUI

Open API from OpenWeatherMap

Inspiring project from Weather-SwiftUI