afw

AFWeather

Getting the weather forecast never has been so easy

Showing:

Popularity

Downloads/wk

0

GitHub Stars

88

Maintenance

Last Commit

7yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

AFWeather

Build Status alt text alt text alt text

Getting the weather forecast never has been so easy and it supports 5 different services. It returns the raw json so you can easily get the data you need.

alt text

##Installation

AFWeather is available on CocoaPods so you can get it by adding this line to your Podfile:

pod 'AFWeather', '~> 1.0'

If you don't use CocoaPods, you will have to import these files into your project:

AFWeather.h
AFWeather.m

##Services supported

Service namePlace name/Zip codeCoordinatesAFWeather name
World Weather OnlineAFWeatherAPIWorldWeatherOnline
Weather Undeground🚫AFWeatherAPIWeatherUnderground
Open Weather MapAFWeatherAPIOpenWeatherMap
AccuWeather🚫AFWeatherAPIAccuWeather
Forecast.io🚫AFWeatherAPIForecast

##Usage

First of all, make sure that you have imported the main class into the class where you are going to get the weather information.

#import "AFWeather.h"

###Configuring the client

In order to make AFWeather know what service are you using and what's your API key, use the method -configureClientWithService:withAPIKey:. Example:

[[AFWeather sharedClient]configureClientWithService:AFWeatherAPIForecast withAPIKey:@"myawesomeapikey"];

###Getting the forecast from a city name or Zip code

For this, use -fetchForecastOfLocationWithName:andCompletionBlock:

Example:

    [[AFWeather sharedClient]fetchForecastOfLocationWithName:@"Murcia" andCompletionBlock:^(NSDictionary *response, NSError *error) {
        
        if (!error) {

            // Handle the response dictionary with all the information
            
        } else {
            
            //Handle the error
        }
    }];

###Getting the forecast from the coordinates

You can also use the latitude and the longitude instead of the place name.

    [[AFWeather sharedClient]fetchForecastOfLocationWithLatitude:@"121.518446" andLogitude:@"-26.181156" andCompletionBlock:^(NSDictionary *response, NSError *error) {
        
        if (!error) {

            // Handle the response dictionary with all the information
            
        } else {
            
            //Handle the error
        }
    }];
    

##License AFWeather is under MIT license so feel free to use it!

##Author Made by Alvaro Franco. If you have any question, feel free to drop me a line at alvarofrancoayala@gmail.com

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100