Latest 0.1.0
Homepage https://github.com/rocxteady/openweathermap-swift-sdk
License MIT
Platforms ios 9.0
Dependencies Alamofire, ObjectMapper
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

openweathermap-swift-sdk is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "openweathermap-swift-sdk"

Usage

API Key
import openweathermap_swift_sdk

OpenWeatherMapClient.client(appID: "app_id")
Getting Current Conditions
import openweathermap_swift_sdk

OpenWeatherMapAPIClient.client.getWeather(cityName: "istanbul") { (weatherData, error) in
    if error == nil && weatherData!.code == "200" {
        //Data received
    }
}
Getting Current Conditions for Several Cities
import openweathermap_swift_sdk

OpenWeatherMapAPIClient.client.getWeather(cityIDs: [524901, 703448, 2643743], limit: 0) { (result, error) in
    if error == nil && result!.code == "200" {
        //Data received
    }
}
Getting Hourly Forecast
import openweathermap_swift_sdk

OpenWeatherMapAPIClient.client.getForecast(cityName: "istanbul", countryCode: "tr", limit: 0) { (result, error) in
    if error == nil && result!.code == "200" {
        //Data received
    }
}
Getting Daily Forecast
import openweathermap_swift_sdk

OpenWeatherMapAPIClient.client.getDailyForecast(cityName: "istanbul", countryCode: "tr", limit: 0) { (result, error) in
    if error == nil && result!.code == "200" {
        //Data received
    }
}

Author

Ulaş Sancak, [email protected]

License

openweathermap-swift-sdk is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "openweathermap-swift-sdk",
    "version": "0.1.0",
    "summary": "Unofficial Swift SDK for OpenWeatherMap.",
    "description": "Unofficial Swift SDK for OpenWeatherMap. It provides JSON model classesnand related REST API GET methods.",
    "homepage": "https://github.com/rocxteady/openweathermap-swift-sdk",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Ulau015f Sancak": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rocxteady/openweathermap-swift-sdk.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "openweathermap-swift-sdk/Classes/**/*.swift",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "dependencies": {
        "Alamofire": [
            "~> 4.4"
        ],
        "ObjectMapper": [
            "~> 2.2"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This