Weather_Video.mp4
MLWeather is an iOS application that displays current weather information for the device location using the OpenWeatherMap API. The app is built using UIKit and follows a modular MVVM-C (Model-View-ViewModel-Coordinator) architecture to ensure maintainability and scalability. The project includes a network layer for API requests and uses CocoaPods as the dependency manager with Kingfisher for image loading.
- Display current weather details including:
- City name
- Weather icon
- Current temperature
- Weather description
- Low and high temperatures
- Wind speed and direction
- Works on light and dark mode
- Works on Portrait and Landscape
- Works on iPhone and iPad (Also on Macbook as iPad App)
- iOS 17.5+
- Xcode 15.4+
- Swift 5.0+
- Clone the repository:
git clone https://github.com/saulurias/MLWeather.git
- Navigate to the project directory:
cd MLWeather
- Install the dependencies:
pod install
- Open the project in Xcode:
open MLWeather.xcworkspace
- Open the project in Xcode.
- Add your OpenWeatherMap API key to
APIEnvironment
:var appId: String { let apiKey: String switch self { case .production: apiKey = "YOUR_API_KEY" // Replace with your actual API key case .development: apiKey = "YOUR_API_KEY" // Replace with your actual API key } return apiKey }
- Build and run the app on a simulator or a physical device.
The project is structured using a modular MVVM-C (Model-View-ViewModel-Coordinator) architecture.
- Model: Defines the data structures.
- View: Manages UI components.
- ViewModel: Handles the business logic and state management.
- Coordinator: Manages the navigation flow and coordination between view controllers.
The network layer handles all API requests and responses, ensuring a clean separation of concerns and easier maintenance.
The app uses the OpenWeatherMap API to fetch weather data.
Example API URL:
https://api.openweathermap.org/data/2.5/weather?lat=34.0194704&lon=-118.491227&appid=YOUR_API_KEY
The project uses CocoaPods as the dependency manager and includes the following dependencies:
- Kingfisher: For downloading and caching images.
To install the dependencies, run:
pod install