Skip to content

Commit

Permalink
Merge pull request #2 from robinwit/master
Browse files Browse the repository at this point in the history
Fix string formats
  • Loading branch information
mxcl committed Apr 22, 2014
2 parents acc15c9 + da9ffce commit fbf3a61
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Modern development is highly asynchronous; isn’t it about time iOS developers

PromiseKit is not just a Promises implementation, it is also a collection of helper functions that make the typical asynchronous patterns we use in iOS development delightful *too*.

PromiseKit is also designed to be integrated into other CocoaPods. If your library has asyncronous operations and you like PromiseKit, then add an opt-in subspec that provides Promises for your users. HOWTO provided later in this README.
PromiseKit is also designed to be integrated into other CocoaPods. If your library has asynchronous operations and you like PromiseKit, then add an opt-in subspec that provides Promises for your users. Documentation to help you integrate PromiseKit into your own pods is provided later in this README.


#Using PromiseKit
Expand Down Expand Up @@ -34,7 +34,7 @@ Synchronous code is clean code. For example, showing a gravatar image:

```objc
NSString *md5 = md5(email);
NSString *url = [@"http://gravatar.com/avatar/%@" stringByAppendingString:md5];
NSString *url = [@"http://gravatar.com/avatar/" stringByAppendingString:md5];
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
self.imageView.image = [UIImage imageWithData:data];
```
Expand All @@ -47,7 +47,7 @@ The asynchronous analog suffers from *rightward-drift*:
```objc
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *md5 = md5(email);
NSString *url = [@"http://gravatar.com/avatar/%@" stringByAppendingString:md5];
NSString *url = [@"http://gravatar.com/avatar/" stringByAppendingString:md5];
NSURLRequest *rq = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
[NSURLConnection sendAsynchronousRequest:rq queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
UIImage *gravatarImage = [UIImage imageWithData:data];
Expand Down Expand Up @@ -84,7 +84,7 @@ Synchronous code has simple, clean error handling:
```objc
@try {
NSString *md5 = md5(email);
NSString *url = [@"http://gravatar.com/avatar/%@" stringByAppendingString:md5];
NSString *url = [@"http://gravatar.com/avatar/" stringByAppendingString:md5];
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
self.imageView.image = [UIImage imageWithData:data];
} @catch (NSError *error) {
Expand All @@ -102,7 +102,7 @@ void (^errorHandler)(NSError *) = ^(NSError *error){
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
@try {
NSString *md5 = md5(email);
NSString *url = [@"http://gravatar.com/avatar/%@" stringByAppendingString:md5];
NSString *url = [@"http://gravatar.com/avatar/" stringByAppendingString:md5];
NSURLRequest *rq = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
[NSURLConnection sendAsynchronousRequest:rq queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {

Expand Down

0 comments on commit fbf3a61

Please sign in to comment.