Dribbble API - Objective-C Synchronous & Asynchronous
Objective-C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dribbble.xcodeproj Changed playerName to read/write. Dec 16, 2013
dribbble Changed playerName to read/write. Dec 16, 2013
.gitignore initial commit Nov 24, 2013
readme.md Reademe updates Nov 24, 2013

readme.md

dribbble-api-objc is another dribbble API for objective-c. The difference is the flexibility and small amount of code. It's synchronous, and asynchronous.

Synchronous Example:

DribbbleResponse * res = [Dribbble everyoneShotsWithOptions:nil completion:nil];
NSLog(@"%@",[res.jsonData objectForKey:@"shots"]);

Asynchronous Example:

[Dribbble everyoneShotsWithOptions:nil completion:(^DribbbleResponse * res){
    NSLog(@"%@",[res.jsonData objectForKey:@"shots"]);
}];

Handling Errors:

[Dribbble everyoneShotsWithOptions:nil completion:(^DribbbleResponse * res){
    if(res.error) {
        NSLog(@"%@",res.error);
    } else {
        NSLog(@"%@",[res.jsonData objectForKey:@"shots"]);
    }
}];

Paging:

Dribbble * everyone = [[Dribbble alloc] initEveryonePager];
[everyone load:(^DribbbleResponse * res){
    NSLog(@"got shots for everyone: %@",res.dribbble.shots);
}];

Dribbble * popular = [[Dribbble alloc] initPopularPager];
[popular loadPages:4 completion:(^DribbbleResponse * res){
    NSLog(@"got 4 pages of shots: %@",res.dribbble.shots);
}];

There are more features. Read the source ;)