The best iOS open source libraries you never heard about

iOS developers have a very rich and dynamic community of open source projects, but most developers only use a fraction of it.
Being the lazy developer that I am, I love finding new and useful open source projects to use (why waste time building something that some one else already made?).
Most of you probably already know some of the famous open source projects such as Three20, ASIHttpRequest, ShareKit, etc. (If not, you have some homework to do) – I will not talk about them today. Instead, in this post I will share with you some of the best, and lesser known, projects that I found.

Utilities

  • BlocksKit – A great collection of extensions to cocoa classes that facilitates block programing. Saves A LOT of time and code.
    Some examples:

        [NSTimer timerWithTimeInterval:1 block:^(NSTimeInterval time) { NSLog(@"Time elapsed: %f", time); } repeats:YES];
    
        [UIAlertView showAlertWithTitle:nil message:@"Alert blocks" buttonTitle:@"OK" handler:^{ /* Do something after alert is dismissed */ }];
    
        UIView *myView;
        [myView whenTapped:^{ [self closeKeyboard]; }];
    
        UIButton *myButton;
        [myButton addEventHandler:^(id sender) { /* handle button click */ } forControlEvents:UIControlEventTouchDown];
    

    And many many more. A must have.

  • ABContactHelper – A very convenient address book wrapper. The best I’ve seen so far. Provides drop in features to search and update the address book easily:
    NSArray *abContacts = [ABContactsHelper contactsStartingWithName:textField.text];
    for (ABContact *abContact in abContacts)
    {
        abContact.image;
        abContact.phoneArray;
        // etc.
    }
    
  • CAAnimationsBlock – Using Core Animation (i.e CABasicAnimation etc.) is much more complicated than simply using a UIView animation, but there are a lot of times when you have no other option but using it, since it provides much more flexibility and power. But not only that Core Animation is much more complicated, it lacks one of the most important features of UIView animations – the blocks notation.
    CAAnimationBlocks allows us to use blocks with Core Animation as simply as we would on UIView animation:

            CABasicAnimation *animation;
            [animation setCompletion:^(BOOL finished){}];
    
  • CHDataStructures – Objective c is not so strong when it comes to data structures, so this is a library of standard data structures which can be used in any Objective-C program. Although the standard Cocoa data structures are very optimized, there are always cases where using the right data structure makes all the difference.
  • Useful components

    • Kal Calendar – This is actually a pretty well known component, but it’s still worth mentioning. Kal is a complete calendar implementation for the iPhone that matches the UI of MobileCal
    • ReorderingTableViewController – A drop in replacement to UITableViewController that provides custom drag and drop functionally. Unlike the basic cocoa implementation of drag and drop – with this component you can easily change the appearance of the dragged cell. drag to reorder is a really great user experience, it’s worth a try.

    Animations and visual effects

    • TweenC – Tweener (originally for actionScript) is one of the coolest animation libraries there is. It gives you access to various complex easing functions for you animations. You can see some nice examples to the concept in the Tweener transitions cheat sheet. TweenC is an objective c wrapper for this library that allows you to use most of the complex tweens:
      [TweenC animateView:myView withAnimation:kTweenEaseOutBounce andDuration:1.0 toPoint:toPoint delegate:self];
      

      Unfortunately, this library is not updated anymore, has quite a few bugs, and is not on github. I hope to someday start contributing to this library myself, because it can really boost up your app.

    • HMGLTransitions – A set of classes which can animate transition between two UIViews or UIViewControllers. It has some really beautiful transition effects. Trust me – it’s worth checking out.
    • JMNoise – An great extension that applies noise to every UIView easily.
      An example of a UIButton that was applied noise using

      [myView applyNoise]

    Where to go from here?

    Obviously, there are hundreds of useful open source projects out there to help us iOS developers, I only listed here some of my favorites. I would really love to hear about some of your favorites, and relatively unknown, open source projects.

    There are also some very good sites where you can find good reusable components, two such sites are:

  • cocoacontrols
  • cocoaobjects
  • And some last words – most of these open source projects are on github, and are just waiting for people to contribute to them. If you are going to fix or add to these projects, consider forking them and push your changes, so that everyone can enjoy your hard work.

    Advertisement

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s

    %d bloggers like this: