Renaming AFGowallaAPI to AFGowallaAPIClient
This commit is contained in:
parent
25daf2cf69
commit
9054026304
6 changed files with 2381 additions and 2267 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
F8D25CC41396948D00CF3BD6 /* AFGowallaAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D25CC21396948D00CF3BD6 /* AFGowallaAPI.m */; };
|
F8D25CC41396948D00CF3BD6 /* AFGowallaAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D25CC21396948D00CF3BD6 /* AFGowallaAPIClient.m */; };
|
||||||
F8D25CC51396948D00CF3BD6 /* AFImageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D25CC31396948D00CF3BD6 /* AFImageRequest.m */; };
|
F8D25CC51396948D00CF3BD6 /* AFImageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D25CC31396948D00CF3BD6 /* AFImageRequest.m */; };
|
||||||
F8D25CC813969DD200CF3BD6 /* AFRestClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D25CC713969DD200CF3BD6 /* AFRestClient.m */; };
|
F8D25CC813969DD200CF3BD6 /* AFRestClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D25CC713969DD200CF3BD6 /* AFRestClient.m */; };
|
||||||
F8E469651395739D00DB05C8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469641395739D00DB05C8 /* UIKit.framework */; };
|
F8E469651395739D00DB05C8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E469641395739D00DB05C8 /* UIKit.framework */; };
|
||||||
|
|
@ -33,9 +33,9 @@
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
F8D25CC01396948D00CF3BD6 /* AFGowallaAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFGowallaAPI.h; path = AFNetworkingExample/Classes/AFGowallaAPI.h; sourceTree = "<group>"; };
|
F8D25CC01396948D00CF3BD6 /* AFGowallaAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; name = AFGowallaAPIClient.h; path = AFNetworkingExample/Classes/AFGowallaAPIClient.h; sourceTree = "<group>"; };
|
||||||
F8D25CC11396948D00CF3BD6 /* AFImageRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFImageRequest.h; path = AFNetworkingExample/Classes/AFImageRequest.h; sourceTree = "<group>"; };
|
F8D25CC11396948D00CF3BD6 /* AFImageRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFImageRequest.h; path = AFNetworkingExample/Classes/AFImageRequest.h; sourceTree = "<group>"; };
|
||||||
F8D25CC21396948D00CF3BD6 /* AFGowallaAPI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFGowallaAPI.m; path = AFNetworkingExample/Classes/AFGowallaAPI.m; sourceTree = "<group>"; };
|
F8D25CC21396948D00CF3BD6 /* AFGowallaAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFGowallaAPIClient.m; path = AFNetworkingExample/Classes/AFGowallaAPIClient.m; sourceTree = "<group>"; };
|
||||||
F8D25CC31396948D00CF3BD6 /* AFImageRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFImageRequest.m; path = AFNetworkingExample/Classes/AFImageRequest.m; sourceTree = "<group>"; };
|
F8D25CC31396948D00CF3BD6 /* AFImageRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFImageRequest.m; path = AFNetworkingExample/Classes/AFImageRequest.m; sourceTree = "<group>"; };
|
||||||
F8D25CC613969DD100CF3BD6 /* AFRestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFRestClient.h; sourceTree = "<group>"; };
|
F8D25CC613969DD100CF3BD6 /* AFRestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFRestClient.h; sourceTree = "<group>"; };
|
||||||
F8D25CC713969DD200CF3BD6 /* AFRestClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFRestClient.m; sourceTree = "<group>"; };
|
F8D25CC713969DD200CF3BD6 /* AFRestClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFRestClient.m; sourceTree = "<group>"; };
|
||||||
|
|
@ -207,8 +207,8 @@
|
||||||
F8E469B71395759C00DB05C8 /* Networking Extensions */ = {
|
F8E469B71395759C00DB05C8 /* Networking Extensions */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
F8D25CC01396948D00CF3BD6 /* AFGowallaAPI.h */,
|
F8D25CC01396948D00CF3BD6 /* AFGowallaAPIClient.h */,
|
||||||
F8D25CC21396948D00CF3BD6 /* AFGowallaAPI.m */,
|
F8D25CC21396948D00CF3BD6 /* AFGowallaAPIClient.m */,
|
||||||
F8D25CC11396948D00CF3BD6 /* AFImageRequest.h */,
|
F8D25CC11396948D00CF3BD6 /* AFImageRequest.h */,
|
||||||
F8D25CC31396948D00CF3BD6 /* AFImageRequest.m */,
|
F8D25CC31396948D00CF3BD6 /* AFImageRequest.m */,
|
||||||
);
|
);
|
||||||
|
|
@ -341,7 +341,7 @@
|
||||||
F8E469CE1395780600DB05C8 /* SpotTableViewCell.m in Sources */,
|
F8E469CE1395780600DB05C8 /* SpotTableViewCell.m in Sources */,
|
||||||
F8E469D11395781500DB05C8 /* Spot.m in Sources */,
|
F8E469D11395781500DB05C8 /* Spot.m in Sources */,
|
||||||
F8E469EC13957FC500DB05C8 /* TTTLocationFormatter.m in Sources */,
|
F8E469EC13957FC500DB05C8 /* TTTLocationFormatter.m in Sources */,
|
||||||
F8D25CC41396948D00CF3BD6 /* AFGowallaAPI.m in Sources */,
|
F8D25CC41396948D00CF3BD6 /* AFGowallaAPIClient.m in Sources */,
|
||||||
F8D25CC51396948D00CF3BD6 /* AFImageRequest.m in Sources */,
|
F8D25CC51396948D00CF3BD6 /* AFImageRequest.m in Sources */,
|
||||||
F8D25CC813969DD200CF3BD6 /* AFRestClient.m in Sources */,
|
F8D25CC813969DD200CF3BD6 /* AFRestClient.m in Sources */,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -26,5 +26,5 @@
|
||||||
extern NSString * const kAFGowallaClientID;
|
extern NSString * const kAFGowallaClientID;
|
||||||
extern NSString * const kAFGowallaBaseURLString;
|
extern NSString * const kAFGowallaBaseURLString;
|
||||||
|
|
||||||
@interface AFGowallaAPI : AFRestClient
|
@interface AFGowallaAPIClient : AFRestClient
|
||||||
@end
|
@end
|
||||||
|
|
@ -20,14 +20,14 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
#import "AFGowallaAPI.h"
|
#import "AFGowallaAPIClient.h"
|
||||||
|
|
||||||
// Replace this with your own API Key, available at http://api.gowalla.com/api/keys/
|
// Replace this with your own API Key, available at http://api.gowalla.com/api/keys/
|
||||||
NSString * const kAFGowallaClientID = @"e7ccb7d3d2414eb2af4663fc91eb2793";
|
NSString * const kAFGowallaClientID = @"e7ccb7d3d2414eb2af4663fc91eb2793";
|
||||||
|
|
||||||
NSString * const kAFGowallaBaseURLString = @"https://api.gowalla.com/";
|
NSString * const kAFGowallaBaseURLString = @"https://api.gowalla.com/";
|
||||||
|
|
||||||
@implementation AFGowallaAPI
|
@implementation AFGowallaAPIClient
|
||||||
|
|
||||||
- (id)init {
|
- (id)init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
#import "Spot.h"
|
#import "Spot.h"
|
||||||
|
|
||||||
#import "AFGowallaAPI.h"
|
#import "AFGowallaAPIClient.h"
|
||||||
|
|
||||||
@implementation Spot
|
@implementation Spot
|
||||||
@synthesize name = _name;
|
@synthesize name = _name;
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
[mutableParameters setValue:[NSString stringWithFormat:@"%1.7f", location.coordinate.longitude] forKey:@"lng"];
|
[mutableParameters setValue:[NSString stringWithFormat:@"%1.7f", location.coordinate.longitude] forKey:@"lng"];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[AFGowallaAPI sharedClient] getPath:urlString parameters:mutableParameters callback:[AFHTTPOperationCallback callbackWithSuccess:^(NSURLRequest *request, NSHTTPURLResponse *response, NSDictionary *data) {
|
[[AFGowallaAPIClient sharedClient] getPath:urlString parameters:mutableParameters callback:[AFHTTPOperationCallback callbackWithSuccess:^(NSURLRequest *request, NSHTTPURLResponse *response, NSDictionary *data) {
|
||||||
if (block) {
|
if (block) {
|
||||||
NSMutableArray *mutableRecords = [NSMutableArray array];
|
NSMutableArray *mutableRecords = [NSMutableArray array];
|
||||||
for (NSDictionary *attributes in [data valueForKeyPath:@"spots"]) {
|
for (NSDictionary *attributes in [data valueForKeyPath:@"spots"]) {
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ If you're tired of massive libraries that try to do too much, if you've taken it
|
||||||
|
|
||||||
### REST Client Request
|
### REST Client Request
|
||||||
|
|
||||||
// AFGowallaAPI is a subclass of AFRestClient, which defines the base URL and default HTTP headers of NSURLRequests it creates
|
// AFGowallaAPIClient is a subclass of AFRestClient, which defines the base URL and default HTTP headers of NSURLRequests it creates
|
||||||
[[AFGowallaAPI sharedClient] getPath:@"/spots/9223" parameters:nil callback:[AFHTTPOperationCallback callbackWithSuccess:^(NSURLRequest *request, NSHTTPURLResponse *response, NSDictionary *data) {
|
[[AFGowallaAPIClient sharedClient] getPath:@"/spots/9223" parameters:nil callback:[AFHTTPOperationCallback callbackWithSuccess:^(NSURLRequest *request, NSHTTPURLResponse *response, NSDictionary *data) {
|
||||||
NSLog(@"%@: %@", [data valueForKeyPath:@"name"], [data valueForKeyPath:@"address.street_address"]);
|
NSLog(@"%@: %@", [data valueForKeyPath:@"name"], [data valueForKeyPath:@"address.street_address"]);
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
|
|
@ -55,7 +55,7 @@ If you're tired of massive libraries that try to do too much, if you've taken it
|
||||||
|
|
||||||
In order to demonstrate the power and flexibility of AFNetworking, we've included a small sample project. `AFNetworkingExample` asks for your current location and displays [Gowalla](http://gowalla.com/) spots nearby you. It uses `AFHTTPOperation` to load and parse the spots JSON, and `AFImageRequestOperation` to asynchronously load spot stamp images as you scroll.
|
In order to demonstrate the power and flexibility of AFNetworking, we've included a small sample project. `AFNetworkingExample` asks for your current location and displays [Gowalla](http://gowalla.com/) spots nearby you. It uses `AFHTTPOperation` to load and parse the spots JSON, and `AFImageRequestOperation` to asynchronously load spot stamp images as you scroll.
|
||||||
|
|
||||||
Take a close look at `AFGowallaAPI` and `AFImageRequest`. These two classes provide convenience methods on top of the core AFNetworking classes. They provide higher-level methods for creating requests, and enqueueing them into an `NSOperationQueue`.
|
Take a close look at `AFGowallaAPIClient` and `AFImageRequest`. These two classes provide convenience methods on top of the core AFNetworking classes. They provide higher-level methods for creating requests, and enqueueing them into an `NSOperationQueue`.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue