Hacker News new | comments | ask | show | jobs | submit login
iOS Libraries (appdevmag.com)
264 points by coderholic on Mar 15, 2011 | hide | past | web | favorite | 76 comments



No clue what happened to the original, but here's a post which lists what they had on their list: http://sordyl.info/2011/03/15/10-ios-libraries-to-make-your-...

MBProgressHUD – Progress Indicator Library

ASIHttpRequest – HTTP Network Library

JSON Framework – JSON Support

Flurry – Detailed Usage Statistics

RegexKitLite – Regular Expression Support

Facebook iOS SDK – Facebook API Library

SDWebImage – Simple Web Image Support

GData client – iPhone library for all of Google’s services

CorePlot – 2D Graph Plotter

Three20 – General iOS Library


I've had some trouble with ASIHTTPRequest. It times out sending POST requests (with decent sized payloads) sending to our Rails server, upwards of 98% of the time. (I've literally only gotten one request to return properly.) Because I'm a masochist, I wrote a minimal replacement using the CFSocket API, and it works fine, every time.

My fear/guess is that something that ASIHTTPRequest is using is assuming that it can bombard the socket with data even when the output buffer gets full. At least that's the initial problem I had when I was writing my replacement, and after staring at ASIHTTPRequest for days, I can't think of anything else.


this is good. I like it!


Also, for game developers, Cocos2D iphone is pretty good too. It's reasonably lightweight, fast, and completely free. Pair that up with Box2D or chipmunk, which it comes with, and you have a complete game engine at no cost, with a good amount of community support.

edit -- link: http://www.cocos2d-iphone.org/


I played with Cocos2d and I liked it a lot. Do you know the differences between Cocos2d and the sparrow framework?


I use the Sparrow framework and find it to mimic the Flash's API more closely, and the API as a whole is less complex. The primary downside at this time is that the community is less active/developed, but the author is very helpful when it comes to answering questions.


No, sorry. Cocos2d is the first I've tried using, as I only just started iOS dev.

edit: A quick peruse through some github samples from their framework, and it looks like their API is busier, but seems to be less mature. This is from five minutes of browsing so may not be completely accurate.


Beware overusing MBProgressHUD. It's a really nice library, but in general you should try to avoid modal progress dialogues in favor of progress that can be presented non-modally.


> Regular Expressions are a really powerful tool, and the absence of support for regular expressions in the iPhone SDK seems to be a glaring omission.

NSRegularExpression was added to the iOS SDK in 4.0.

Not available if you still aim to be 3.x-compatible (for iPhones and first-gen Touch), but 4.0 has been out for 9 months now, I think it's time to bury this one (note: you could still find NSRegularExpression insufficient or inferior to RKL, that's a different issue).


The Syntax for NSRegularExpression is really awful. Main reason why I stick with RegexKitLite.


Sure, as I said you can find RegexKitLite superior for a variety of reasons, but that's different from the original complaint that the iOS SDK ships without regex support.


In fact, I believe this was available in iOS 3.2. But definitely on all devices as of 4.0.


iOS 3.2 is not available for the iPhone and iPod touches, if I'm not mistaken, so you would still only be targeting iPads that have failed to update to 4.2.1 and/or 4.3.


Precisely.


JSONKit (https://github.com/johnezang/JSONKit) is quite a bit faster than the mentioned json-framework.

Also, an alternative to SDWebImage is EGOImageLoading (https://github.com/enormego/EGOImageLoading), which might or might not be better (Instagram uses it).

We've been using both libraries quite happily for our new startup, forkly.


JSONKit is less stable than yajl/touchjson/json-framework is. I was seeing 2-3 crashes/day in it when I last tried using it[1], switched back to yawl and haven't had any crashes in json parsing since.

1. About three weeks ago.


People forget that you can just use C for the simple stuff. Many of these Objective-C classes are slow, verbose, buggy, and poorly documented compared to the equivalent open source C libraries. In many cases the C API is just as nice - maybe slightly less fancy, but polished from years of actual use. Why use ASIHTTPRequest or NSHTTPRequest when libcurl is mature and fast and cross-platform? What do you really gain by wrapping Objective-C around your regex or date handling? You'll find out when you start profiling (or porting to any non-Apple system).

The Objective-C language (Smalltalk in C) was a nice idea (in the 80s...) but newcomers to iOS should be aware that the non-UI parts of the Cocoa/UIKit libraries are garbage compared to what C programmers have built over the past thirty years. I've had to replace enough of the ObjC libraries I've used with plain C that I just start with the C code now.


If you want to talk about tested and battle-hardened code, make sure that you really have the older API :)

Foundation (and, by extension, NSHTTPRequest and NSURLConnection and such) is a few years older than cURL is. Foundation is really an implementation of the OpenStep API designed by Sun and NeXT. in 1993. cURL was released in 1997.

What do you lose by having a higher level of abstraction that is more flexible? Do you have raw profile data that shows that libcurl is significantly faster and performs better?

Newcomers to anything should be aware that old biases die hard and people on the internet should be taken with a grain of salt.


What do you gain by wrapping Objective-C around your regex?

Me being vastly more productive. Extract all the http like URL's from a string and print them:

  for(id match in [searchString componentsMatchedByRegex:@"\\bhttps?://[a-zA-Z0-9\\-.]+(?:(?:/[a-zA-Z0-9\\-._?,'+\\&%$=~*!():@\\\\]*)+)?"]) {
    printf("URL: %s\n", [match UTF8String]);
  }
I dare you, I double dog dare you to do the same thing in three lines of code with C and PCRE.


ShareKit http://www.getsharekit.com/ is also an awesome library for sharing content on social sites.


I was just going to mention it. I think it's way better than the facebook library mentioned in the article. I'm using for my upcoming app and it was a snap to use it for facebook and twitter


I played with ShareKit for a while and it does include an impressive range of sharing options (and really helped me understand how OAuth works). However I found that the sharing functionality seemed to be tied to a specific visual presentation, which I didn't like. In the end, I decided not to use it because it didn't match the look and feel I wanted for my app.


Have you had trouble changing the UI? I haven't tried ShareKit but the website highlights "Customizable UI" as one of the main features.


A few days ago I released the DateCalculations library which was inspired by Ruby on Rails calculation library. I'll leave it here just in case: https://github.com/oscardelben/DateCalculations


Thank you! I'm coming up to the point of needing that very soon.


How timely..thanks!!


The list is quite crappy. E.g. :GData client" doesn't help you unless you really need it. If you search for the little things, like weak-linked yet self deleting delegates, or good image crunching stuff, check out PSFoundation.

https://github.com/steipete/PSFoundation

And if you wanna have it set up for you, just clone the app template: https://github.com/steipete/PSiOSAppTemplate


I just spent some time looking over PSFoundation and it's a great aggregation of useful classes from all over the place.

AND there's some great original code. E.g., PSActionSheet, that let's you assign a block to each button. I hate coding up the action sheet delegate and blocks make this typically ugly thing quite shiny.

PSFoundation is definitely worth a look.


That's good stuff, helped me get started a while back :)


Yea, I found a bunch of good projects from your repo a while back. I ended up just using those projects instead though, as having a layer of repository-indirection just didn't sit well with me.


This one is of promise. We are evaluating it and trying it out (and sometimes ripping it out).

http://restkit.org/

"RestKit is an Objective-C framework for iOS that aims to make interacting with RESTful web services simple, fast and fun. It combines a clean, simple HTTP request/response API with a powerful object mapping system that reduces the amount of code you need to write to get stuff done."


I've played around with it and my team is using it on our current project. I've found it to be a bit rough around the edges. It's still in the process of transforming from an internal resource to a community based open source project, but I think the two toasters crew is very serious about making it work and are doing a great job.

I'd recommend others try it out if you aren't afraid of dipping into their code. I found it to be quite readable and the two toasters team have shown themselves to be very good at communicating with other people interested in the project. My hope is that they will continue to work through the kinks and RestKit can become a standard library for apps dealing with RESTful services.


We were playing with it too, but ended up doing our own thing in the end.


Link doesn't work. "appdevmag.com" doesn't work. Googled "site:appdevmag.com" and got zero hits.

WTF?



I’ve written a block-based UIAlertView and UIActionSheet wrapper that makes working with alerts and action sheets less painful (no more button indexes and alert tags):

https://github.com/zoul/Lambda-Alert


You shouldn't have. I'm using UIAlertView+Blocks for years now. (PLBlocks in the 3.x times)

https://github.com/steipete/PSFoundation/blob/master/Utils/P...

Also check out PSFoundation, great stuff in there.


ASIHttpRequest (hated handling network requests before), RegexKitLite (still superior to the recent NSRegEx) and Flurry (why doesn't apple give you this level of detail) are fantastic. Flurry's size is a bit of a downer, but implementation is easy.


[FlurryAPI setSessionReportsOnCloseEnabled:NO] seems to avoid some crashes on reporting logging data.


Any recommendations for libraries related to user account sign-up / authentication? I'm working on building a multi-player game and want to avoid using Facebook (or another 3rd party) for user authentication.


Apple's GameCenter works really, really well for that. It's part of the GameKit framework.


I can't recommend it, because I haven't used it yet, but OpenFeint works on iOS and Android, if that's important to you. http://www.openfeint.com/


I've used OpenFeint. Integration is a breeze, and their staff are really responsive and friendly. Plus you get a the benefit of their Free Game of the Day promotion.


I like OpenFeint too, but there are some things to keep in mind. First, integrating OpenFeint adds a few MB to your app size if you support both landscape and portrait modes (I'm not sure what the exact size is - sorry). This can be an important consideration if you're close to the over-the-air limit. Second, Free Game of the Day is a great program, but it is something you need to apply to. Not every game gets accepted.


As far as FGOTD: OpenFeint contacted us to use our game for FGOTD - we didn't really apply or anything like that. However, word of caution - any time your game is free, you will get bottom-feeders expecting everything (this is a different discussion altogether)

Back to the point, we only use our game in landscape mode, and we went from 70+ source files to 900+ source files after we added OF. So yeah, good point about OTA limit. :)


Funny, I was just wondering this morning if there's code somewhere to do the "pull to refresh" action on tables that everyone seems to be adding recently. Found a good round up here: http://iosdevgoodies.joostschuur.com/pull-and-release-refres.... On further inspection the three20 version uses the EGO version.


i tried MBProgressHUD. it is way too heavy. so i wrote my own, smaller one:

http://www.platinumball.net/blog/2010/02/27/uiprogresshud-re...


I'm not sure what you found heavy about it; it's feature-full, yes. (I'm a bit familiar with the code because I used it in a project of my own and have my own fork of it at GitHub.)


well, for one thing, one of its modes is to launch a background thread to perform a user-specified operation while it is being displayed. not something a control should be doing.


That is just one of it's modes, and while in theory I agree with the separation of concerns, the cognitive overhead of coordinating the control with the worker thread vs letting MBProgressHUD manage both is substantial.

It's a fairly small addition for how much poet it gives. I agree that it's not for everyone.



Posted this just before I headed off to a meeting. Back from the meeting, and my server is fried :)

Rebooted and back up now. Thanks for all the comments!


I've never tried iOS development, and I'm a bit surprised by many of these library recommendations. For example HTTP requests, regular expressions and progress indicators strike me as something your platform definitely should provide you with. Of course it's great that there are quality libraries to fill in where the platform falls short.


Most of the functionality is there, it is just lower level coding than is required for many purposes. Sure, you can do HTTP requests, but if you are interacting with a ReSTful service, having a wrapper that understands ReST is better.


These libraries exist because iOS (IMHO) is too low level in places, such as HTTP requests. There is an interface you have to implement in order to make HTTP requests, and you have to handle all the data (bytes) that come in incrementally. It is very handy to have a library that handles the connection, caching, redirects, errors, etc.


The NSURLConnection class is actually pretty high level and does in fact handle things like caching, redirects, errors, etc. for you. I have been using ASIHttpRequest for a while -- it's not bad but can feel quite heavy at times. For future projects, I may roll my own HTTP lib by wrapping NSURLConnection directly. Btw, GCD and blocks in iOS 4 make it super easy to structure your network calls the same way you would in JavaScript with xmlhttprequest and closures, which makes async code much cleaner and easier to write.


Even on platforms where making an http request is still only a few lines of standard library code (ruby, nodejs, python) -- there is still a vast selection of libraries that make it easier for you. (httparty, request, etc)


Tapku - a few light-weight, handy classes: Coverflow, Graph, Month Calendar View, EmptyView, Shake Window, Label Table View Cells, Alert Center, Circle View

https://github.com/devinross/tapkulibrary


Great little framework. The Month Calendar View is very similar to Apple's Mobile Calendar.

Kal is another great Calendar Clone. https://github.com/klazuka/Kal


I think we blew up "Flurry Analytics"; attempting to register just keeps returning the registration page, with no error messages...


Flurry's registration portal should be able to handle HN traffic without any trouble. I'll e-mail them.

EDIT: This looks like a bug, but a bug caused by a user registering with an e-mail already in the system. I'm guessing you've either used Flurry (or Pinch Media, which merged with Flurry) before. Try the 'forgot your password?' link, it'll send you a new one.


You're right, I think I had an account with "Pinch" at one time, but I wasn't getting a "you're already registered" error so I assumed the worst...

...excellent product however and I look forward to using it!


I've been working on a database wrapper for SQLite to replace some plist serialization stuff I was using. It's still in the early alpha stages, but it's SOOO much easier to use than Core Data.

https://github.com/AKQADC/Merlin


Are there similar libraries for Android development? The hardest problem I have is with making the UI look better than standard/default UI on both iPhone and Android. Libraries that made that easier would be awesome.



Please don't. I'd much rather have a consistent UI on my phone instead of each dev brewing up his own controls.


There seems to be a lot of room especially on mobile for applying a "theme" to system controls...


I have written a light c-based api to access a windows file-share. Light samba so to say; in case anyone can use it: https://github.com/38leinaD/tango


Is there a good way to authenticate youtube? The GData stuff I've found was janky at best. It worked on a newly created account, but didn't work on my age old pre-acquisition account


That's not really a GData issue. I think GData ClientLogin no longer works for YouTube accounts that are not linked to a Google account. AuthSub or OAuth should still work though.


Props for the headline edit according to house style http://ycombinator.com/newsfaq.html


Not just a library, and something that really makes development for iOS easier is Unity. http://unity3d.com

It may not be free, but it is well worth the money. I use it for non-game apps because development is so rapid.


Interesting! Could you share urls to the non-games you made using unity?


What would really make my iOS life easier is a good RSS client. I'm hoping for something that I can give a URL to and which will give me back an NSArray of dictionaries of entires, or something like that.

Too much to ask? Or should I just go the XML parsing route? (which seems like it would be a lot of work and brittle) I've not yet dug into this, but this is the next set of functionality I have to work on.


MWFeedParser sounds like exactly what you are looking for. It is really easy to use.

https://github.com/mwaterfall/MWFeedParser


I made a very simple one, extracted from the Rackspace iPhone app: https://github.com/greenisus/cocoa-rss

It may be rough around the edges though.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: