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
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.
NSArray *abContacts = [ABContactsHelper contactsStartingWithName:textField.text]; for (ABContact *abContact in abContacts) { abContact.image; abContact.phoneArray; // etc. }
CAAnimationBlocks allows us to use blocks with Core Animation as simply as we would on UIView animation:
CABasicAnimation *animation; [animation setCompletion:^(BOOL finished){}];
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:
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.