This repo has been deprecated and replaced by OpenWeatherMap, a Swift Package.
LocalWeatherKit simplifies communication with OpenWeatherMap API.
This project creates a local pod and was developed using cocoapods 1.2.0.beta.3 and cocoapods-core 1.2.0.beta.3
-
Get OpenWeatherMap API key (https://openweathermap.org/appid)
-
Reference LocalWeatherKit pod in your podfile
pod 'LocalWeatherKit', :path => '../LocalWeatherKit'
- Add the following imports
#import "LWKManager.h"
#import "LWKCities.h"
#import "LWKCity.h"
- Call methods on LWKManager to get weather data and enjoy!
-(void)getCurrentWeatherByCityId:(NSInteger)cityId
apiKey:(NSString *)apiKey
withSuccess:(void (^)(id responseObject))success
withFailure:(void (^)(NSError *error))failure;
-(void)get5DayForecastByCityId:(NSInteger)cityId
apiKey:(NSString *)apiKey
withSuccess:(void (^)(id responseObject))success
withFailure:(void (^)(NSError *error))failure;
-(void)getCurrentWeatherByCoordinatesWithLatitude:(float)latitude
longitude:(float)longitude
apiKey:(NSString *)apiKey
withSuccess:(void (^)(id responseObject))success
withFailure:(void (^)(NSError *error))failure;
-(void)getCurrentWeatherByCoordinatesWithLatitude:(float)latitude
longitude:(float)longitude
expectedCityCount:(NSInteger)expectedCityCount
apiKey:(NSString *)apiKey
withSuccess:(void (^)(id responseObject))success
withFailure:(void (^)(NSError *error))failure;
OpenWeatherMap API specifies image name and provides a basic set of images. For alternative images, look at LocalWeatherImages
The MIT License (MIT)
Copyright (c) 2017 Anthony Arzola
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.