EasyWeather is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'EasyWeather'
- Get the weather of the day.
- Get the weather forecast for the next three days.
- Check sunrise, sunset, maximum temperature, minimum temperature, air index, wind power, wind direction, weather.
- The network cache is valid for 300 seconds.
#import <EasyWeather/EasyWeather.h>
...
NSString *cityName = @"上海";
EasyWeather *easyWeather = [[EasyWeather alloc] init];
EWCityModel *cityModel = [easyWeather cityModelWithName:cityName];
[easyWeather requestWeatherInfoWithCity:cityModel completion:^(NSError *error, NSDictionary *result) {
if (!error) {
// get weather info from result
} else {
NSLog(@"ERROR: %@", error.localizedDescription);
// get error info
}
}];
Ethan89, [email protected]
EasyWeather is available under the MIT license. See the LICENSE file for more info.