-
Notifications
You must be signed in to change notification settings - Fork 11
/
AFWeather.h
43 lines (31 loc) · 1.12 KB
/
AFWeather.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// AFWeather.h
// AFWeather-Demo
//
// Created by Alvaro Franco on 4/22/14.
// Copyright (c) 2014 AlvaroFranco. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, AFWeatherAPI) {
AFWeatherAPIWorldWeatherOnline,
AFWeatherAPIWeatherUnderground,
AFWeatherAPIForecast,
AFWeatherAPIOpenWeatherMap,
AFWeatherAPIAccuWeather,
AFWeatherAPITest
};
typedef NS_ENUM(NSInteger, AFWeatherLocationType) {
AFWeatherLocationTypeName,
AFWeatherLocationTypeLatLon,
AFWeatherLocationTypeCurrent
};
@interface AFWeather : NSObject
typedef void (^completionBlock)(NSDictionary *response, NSError *error);
+(instancetype)sharedClient;
-(void)configureClientWithService:(AFWeatherAPI)service withAPIKey:(NSString *)apiKey;
-(void)fetchForecastOfLocationWithName:(NSString *)locationName andCompletionBlock:(completionBlock)completion;
-(void)fetchForecastOfLocationWithLatitude:(NSString *)lat andLogitude:(NSString *)lon andCompletionBlock:(completionBlock)completion;
@end
@interface NSString (AFURLEncoding)
-(NSString *)encodeForURLWithEncoding:(NSStringEncoding)encoding;
@end