Networking with the Weatherstack API with (Async/ Await)
This project demonstrates how to interact with the Weatherstack API to fetch real-time weather data. It's designed to help developers understand the process of making network requests and handling responses from a weather data provider.
- Current Weather Data: Retrieve real-time weather information for any location worldwide.
- API Integration: Learn how to integrate and authenticate with the Weatherstack API.
- JSON Parsing: Understand how to parse JSON responses to extract relevant weather details.
- Swift development environment
- An active Weatherstack API key
git clone https://github.com/hanisa1/NetworkingWeatherstack.git
cd NetworkingWeatherstackThen open NetworkingWeatherstack.xcodeproj in Xcode.
-
Obtain an API Key
Sign up at Weatherstack to get a free API key. -
Configure the API Key
In the project, locate the NetworkManager. Replace the API Key with your key:let weatherstackAPIKey = "YOUR_API_KEY_HERE"
This project uses Swift’s native URLSession for networking. No external libraries are required.
This project is licensed under the MIT License.
Note: Always keep your API keys safe. Avoid committing them directly to public repositories.