04

Sep

iOS Twitter integration stopgap

I think it's fair to state that most-if not all-iOS developers are excited about iOS 5.0's OS level integration with Twitter. While we wait for iOS 5.0 to arrive and for users to upgrade, integrating Twitter into an iOS app can be done in one of two ways.

One: the purist way

The purist way is to use Twitter's strict OAuth 1.0 support to enable the user to login to twitter using a webkit webview from within your app. Doing this usually requires using a half-baked open-source library (if you can call it that) to manage the webView and strip

16

Jul

Easiest way to download remote files for iOS

I updated and open-sourced a utility for downloading web-hosted files for iOS today. Using it is extremely easy and doesn't require any notifications or delegates. Only sexy block syntax.

First, you'll need to import it in your implementation file:

 #import "RemoteDataManager.h" 

Then you can:

 NSString *location = @"http://tailsmagazines.files.wordpress.com/2009/04/kitten.jpg?w=320&h=480"; [[RemoteDataManager sharedManager] getDataAtLocation:location withCallback:^(BOOL waiting, NSData *data){ if(waiting){ // if the data is not cached [loadingIndicator startAnimating]; } // when the data is available else{ [loadingIndicator stopAnimating]; imageView.image = [UIImage imageWithData:data]; } }]; 

The key thing to acknowledge here is that the Callback block may get