diff --git a/README.md b/README.md index 30b17e9..777a679 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,88 @@ - + -## A delightful iOS and OS X networking framework -### There's a lot to be said for a networking library that you can wrap your head around. API design matters, too. Code at its best is poetry, and should be designed to delight (but never surprise). - -AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of familiar Foundation network classes, using `NSOperation` for scheduling and concurrency, and blocks for convenience and flexibility. It's designed to make common tasks easy, and to make complex tasks simple. - -## Documentation - -API documentation is available at [http://afnetworking.org/Documentation](http://afnetworking.org/Documentation). - -To install the API docset directly into your local Xcode organizer, first [install `appledoc`](https://github.com/tomaz/appledoc), and then clone this project and run `appledoc -p AFNetworking -c "Alamofire" --company-id com.alamofire AFNetworking/*.h` - -If you're looking for something more human-friendly, or more conceptual in nature, be sure to [check out the Wiki](https://github.com/AFNetworking/AFNetworking/wiki). - -## Example Projects - -Be sure to download and run the example projects for iOS and Mac. Both example projects serve as models of how one might integrate AFNetworking into their own project. - -## Example Usage - -### JSON Request +AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of [`NSURLConnection`](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html), [`NSOperation`](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSOperation_class/Reference/Reference.html), and other familiar Foundation technologies. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use. For example, here's how easy it is to get JSON from a URL: ``` objective-c -NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://gowalla.com/users/mattt.json"]]; +NSURL *url = [NSURL URLWithString:@"https://gowalla.com/users/mattt.json"]; +NSURLRequest *request = [NSURLRequest requestWithURL:url]; AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { NSLog(@"Name: %@ %@", [JSON valueForKeyPath:@"first_name"], [JSON valueForKeyPath:@"last_name"]); } failure:nil]; - -NSOperationQueue *queue = [[[NSOperationQueue alloc] init] autorelease]; -[queue addOperation:operation]; +[operation start]; ``` +Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac. + +Choose AFNetworking for your next project, or migrate over your existing projects--you'll be happy you did! + +## How To Get Started + +- [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/zipball/master) and try out the included Mac and iPhone example apps +- Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles in the wiki](https://github.com/AFNetworking/AFNetworking/wiki) +- Check out the [complete documentation](http://afnetworking.org/Documentation/) for a comprehensive look at the APIs available in AFNetworking + +## Overview + +AFNetworking is architected to be as small and modular as possible, in order to make it simple to use and extend. + +
| Core | |
|---|---|
| AFURLConnectionOperation | +An NSOperation subclass that implements the NSURLConnection delegate methods. | +
| HTTP Requests | |
| AFHTTPRequestOperation | +A subclass of AFURLConnectionOperation for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. | +
| AFJSONRequestOperation | +A subclass of AFHTTPRequestOperation for downloading and working with JSON response data. | +
| AFXMLRequestOperation | +A subclass of AFHTTPRequestOperation for downloading and working with XML response data. | +
| AFPropertyListRequestOperation | +A subclass of AFHTTPRequestOperation for downloading and deserializing objects with property list (plist) response data. | +
| HTTP Client | |
| AFHTTPClient | +
+ Captures the common patterns of communicating with an web application over HTTP, including:
+
+
|
+
| Images | |
| AFImageRequestOperation | +A subclass of AFHTTPRequestOperation for downloading an processing images. | +
| UIImageView+AFNetworking | +Adds methods to the UIKit frameworkâs UIImageView class. The methods in this category provide support for loading remote images asynchronously from a URL. | +