openweathermap-objc-sdk 0.1.0

openweathermap-objc-sdk 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2017

Maintained by Ulaş Sancak.



 
Depends on:
AFNetworking~> 3.1
JSONModel~> 1.7
 

  • By
  • Ulaş Sancak

Example

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

Installation

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

pod "openweathermap-objc-sdk"

Usage

Getting Current Conditions
#import <openweathermap_objc_sdk/OWMSDK.h>

[[OWMAPIClient client] getWeatherByCityName:@"istanbul" block:^(OWMWeather *weatherData, NSError *error) {
    if (!error && [weatherData.code isEqual:@"200"]) {
        //Data received
    }
}];
Getting Current Conditions for Several Cities
#import <openweathermap_objc_sdk/OWMSDK.h>

[[OWMAPIClient client] getWeatherByCityIDs:@[@524901,@703448,@2643743] limitResultByCount:0 block:^(OWMWeatherArrayResult *result, NSError *error) {
    if (!error && [result.code isEqual:@"200"]) {
        //Data received
    }
}];
Getting Hourly Forecast
#import <openweathermap_objc_sdk/OWMSDK.h>

[[OWMAPIClient client] getForecastByCityName:@"istanbul" countryCode:@"tr" limitResultByCount:0 block:^(OWMWeatherArrayResult *result, NSError *error) {
    if (!error && [result.code isEqual:@"200"]) {
        //Data received
    }
}];
Getting Daily Forecast
#import <openweathermap_objc_sdk/OWMSDK.h>

[[OWMAPIClient client] getDailyForecastByCityName:@"istanbul" countryCode:@"tr" limitResultByCount:0 block:^(OWMDailyForecastResult *result, NSError *error) {
    if (!error && [result.code isEqual:@"200"]) {
        //Data received
    }
}];

Author

Ulaş Sancak, [email protected]

License

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