Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix string formats #2

Merged
merged 2 commits into from
Apr 22, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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