An MGTwitterEngine Replacement, with Objective-C blocks for callbacks
Objective-C Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ADEngineBlock
ADEngineBlockDemo
.gitignore
.gitmodules
LICENSE
README.md
format_code.sh
uncrustify.conf

README.md

Purpose:

The hope for ADEngineBlock is to support the full Twitter API and provide Authorization through OAuth. The major difference between ADEngineBlock and most of the other TwitterEngine solutions that I've come across is that EngineBlock will use Objective-C blocks as the callbacks for your Twitter API invocations. This should hopefully solve a lot of threading issues, along with making your code less verbose.

Usage:

 ...
 #import "ADEngineBlock.h"
 ...
 // returns a block that takes an NSArray of tweets and/or an NSError
 // and either updates a tableview, or logs the error
- ( void (^)(NSArray *result, NSError *error) )updateTweetsHandler
{
	/* block magic :-) */
	return [[^(NSArray *result, NSError *error)
	         {
				 if(![result isKindOfClass:[NSArray class]])
				 {
					 NSLog (@"There was a problem");
					 NSLog (@"Error: %@", [error description]);
					 return;
				 }
				 self.tweets = [result mutableCopy];
				 [self.tableView reloadData];
			 } copy] autorelease];
}
 ...
 // get the user timeline for user "snakes_nbarrels",
 // and use the updateTweetsHandler to handle the result
 - (void)fetchStatuses
{
	[self.engine userTimelineForScreenname:@"snakes_nbarrels"
	                                userId:0
	                               sinceId:0
	                                 maxId:0
	                                 count:4
	                                  page:2
	                              trimUser:NO
	                            includeRts:NO
	                       includeEntities:NO
	                           withHandler:[self updateTweetsHandler]];
}

Submodules:

ADEngineBlock depends on a number of other projects/source which have been set up as git submodules.

The steps to get all of the source to build ADEngineBlock are:

 git clone git://github.com/adamvduke/ADEngineBlock.git
 cd ADEngineBlock
 git submodule init
 git submodule update

The submodules will be their own git repositories in the directory ADEngineBlock/External/.

In order to build ADEngineBlockDemo, one of the submodules, ADOAuthorizeiOS, has it's own submodule that needs to be initialized.

 cd ADEngineBlockDemo/External/ADOAuthorizeiOS
 git submodule init
 git submodule update

Third party dependencies:

Credits:

ADEngineBlock includes ideas/code from