9 ms·
IOS Boilerplate: A base template for iOS apps
- benguild 15y agoThis is awesome!
- epo 15y agoTypo 2nd bullet, "freamwork", 3rd bullet "intented". Actually, I'll stop there. Lots of typos, you should get them fixed, it makes you look sloppy.
- Aqua_Geek 15y agoForked, fixed, and pull request sent: https://github.com/gimenete/iOS-boilerplate/pull/1 https://github.com/gimenete/iOS-boilerplate/pull/1
- gimenete 15y agoThanks a lot. I merged your changes :)
- Pewpewarrows 15y agoNot the author, just a general question: There's obviously no replacement for a real copywriter, but is there some service I can possibly run my site(s) through to try and automatically catch stuff like this? Maybe with an API to ignore certain technical words that they think might be misspelled? I could definitely see using that as part of a test or integration step.
- nknight 15y agoAny modern text editor? Spell check hasn't been the exclusive domain of the big bulky word processors in years.
- irvingruan 15y agoVery cool, thanks!
- mprovo1 15y agoGood job, I love this. I find that FastCells are less useful these days as iphone 3G are less common. I prefer to design my complex cells in interface builder for ease of maintenance. But it's just personal taste. Otherwise, everything in there should be very useful for almost any app. I suggest you add support for external services, like Facebook for instance (which a lot of projects use). BTW, I love DictionaryHelper, it definitely saves you a lot of headaches if you work with a JSON api!
- henry501 15y agoDespite the typos, it does look interesting. Is there anything similar for Android?
- div 15y agoIt's not really a boilerplate version, but there's a great answer on StackOverflow that keeps a list of pretty solid 3rd party libraries. http://stackoverflow.com/questions/4078479/what-android-3rd-party-libraries-are-there/4078596#4078596 http://stackoverflow.com/questions/4078479/what-android-3rd-...
- fady 15y agoEver since HTML5 Boilerplate was launched, a whole plethora of projects have been popping up which were inspired by it. Thanks to all the main devs of H5 Boilerplate and projects a like. Makes learning easier and fun!
- sunkencity 15y agoNice! For this to be really useful though I'd like to see all included projects being MIT licensed or something. Now it's a mixture of no license at all (EGOTableViewPullRefresh), BSH (ASIHttprequest), JSONKit is well licensed with dual BSD License/Apache License, SVProgressHUD has a license but it seems home made. And what is the license of the actual boilerplate?
- gimenete 15y agoI have added the license terms in each file I have created. Any suggestion is welcome. I just want anybody to be able to use it without limitations, just keeping the copyright notice.
- shadowmatter 15y agoLooks good. Just FYI: There's already a MapKit class called MKPointAnnotation that provides a simple implementation of MKAnnotation, so your Place class is redundant: MKPointAnnotation *point = [[MKPointAnnotation alloc] init]; point.coordinate = CLLocationCoordinate2DMake(35.01234, -115.56789); point.title = @"The title!"; point.subtitle = @"The subtitle!"; [point release];
- gimenete 15y agoThanks for your comment. I didn't know about MKPointAnnotation.
- Greenisus 15y agoWhen I saw this, I thought "wow, this is pretty much exactly the same stuff I include every time I start a new iOS project." I feel like it would make more sense as a project template though. It seems like if I use this to start a new project, I need to clone the repo and then change a lot of classes to get started. Or am I missing something?
- steipete 15y agoYou are. There are much better choices out there. Check AFNetworking for example.
- Greenisus 15y agoi had never heard of AFNetworking until today. definitely going to try it out.
- Aqua_Geek 15y agoFrom the site: "At this moment iOS Boilerplate is just an XCode project. Is planned to be released as a true XCode template in a near future."
- reidmain 15y agoHaving to copy in 4-5 frameworks every time you start a project is not a bad thing. Alternatives are always emerging to even the most used frameworks. Every time I start a project it is a time to look and see if there are better ways to do things. Also including frameworks that you will never use is bad practice. Most apps are not going to make use of MapKit. If you're not going to use it why bother bloating your project?
- Greenisus 15y agoi agree with you, especially on not including MapKit
- alexbell 15y agoThis is great so far, you have an excellent taste in frameworks. It's also nice and light weight. I would suggest adding a singleton macro. Will try and put some of the boilerplate stuff I use in as a pull request when I get the time.
- xinsight 15y agoI used to love the Singleton (anti-)pattern. It's a huge improvement from using your AppDelegate as a global storage area, but it still encourages sloppy code. I find it the code much cleaner when you pass in the objects a class needs instead of calling up the singleton from all over the place. There are some legitimate uses for singletons, but if you need a singleton macro, you're probably over using it.
- lukeredpath 15y agoI'm no fan of singletons either, but writing one with GCD dispatch_once is pretty simple. Nevertheless, I do have a macro for it: http://lukeredpath.co.uk/blog/a-note-on-objective-c-singletons.html http://lukeredpath.co.uk/blog/a-note-on-objective-c-singleto... It's really for creating "shared" instances rather than true singletons, but who honestly needs a real singleton?
- alexbell 15y agoThis is cool!
- smharris65 15y agoHow does this project compare to the three320 project originally started by Joe Hewitt from Facebook? 320 seems to have more features: https://github.com/facebook/three20/ https://github.com/facebook/three20/
- gte910h 15y ago320 is a little bloated and pretty difficult to keep working in Xcode 4 today. The 320 devs appear to still be on Xcode3, and demand a bunch of nonstandard settings on Xcode4 to make it work (including a scary script which edits your project in all sorts of ways).
- alexbell 15y agoThis project is much more lightweight. three20 certainly has more features, but it is large and relatively complicated compared to this. IMO, this project has a much more narrow scope. And that is a good thing when I don't need all the three20 features (the majority of the time). For all the good three20 does it can be cumbersome to integrate into a large project, and it's documentation is less than stellar.
- reidmain 15y agoNimbus by Jeff Verkoeyen is inspired by Three20 https://github.com/jverkoey/nimbus https://github.com/jverkoey/nimbus He realized that Three20 was becoming pretty bloated and outdated and created this spinoff project. I'd say both this and Three20 are pretty bloated and dated. They are both great reference projects to see how things could be done but in general there are a lot more lightweight alternatives out there.
- wallflower 15y ago320 was written in a manner that is very non-Cocoa like. We cringe when we get a project that uses 320.
- jmatthew3 15y agoI use three20, but only to use TTStyledTextLabel - is there a better way (now) to put rich text in a cell?
- matttthompson 15y agoA much easier way to add async HTTP and image requests would be to just use AFNetworking (https://github.com/gowalla/AFNetworking https://github.com/gowalla/AFNetworking) The rest of this I could really take or leave. Really wish there was something better than EGOPullToRefresh in wide use...
- Greenisus 15y agoHow is AFNetworking easier than ASIHTTPRequest?
- matttthompson 15y agoSimple block-based API, significantly less lines of code to accomplish the same tasks, and smaller, more understandable codebase that uses Foundation classes (e.g. NSURLRequest, NSURLResponse, etc.), rather than re-inventing the wheel And though I don't have the exact numbers, AFNetworking is really fast, maybe 2-3x over ASI in average cases, from my experience and what other users report. Take a look at the examples in the README and compare that to how you'd do the same in ASI.
- stevenp 15y agoAFNetworking looks great, but I'm also curious as to what the advantage is over ASIHTTPRequest.
- Zev 15y agoI typically use PullToRefresh from https://github.com/leah/PullToRefresh https://github.com/leah/PullToRefresh instead of EGOTableViewPullRefresh. It positions itself as a superclass that handles all of the logic, rather than an external object that handles the delegate methods (as EGO does).
- awolf 15y ago>There is an example of how to calculate the directions between two points using the Google Maps API and showing it on a MKMapView using map overlays. See DirectionsExample.m. FYI I believe using the Google Maps API in this manner runs afoul of Google's terms. Google only wants you to use their directions information on top of maps loaded for web sites via their JavaScript interface. MKMapView doesn't qualify.
- zbowling 15y agoThis isn't really necessary and most of these packages will be obsolete in iOS 5 and using a few them (like ASIHTTPRequest) will get you in trouble with ARC. * JSONKit - It's an ok choice but there are literally 5 choices I can think of off the top of my head (not including the now built in JSON support in Lion and iOS 5). I prefer SBJSON because it was once benchmarked with the fastest read speed and it has a dirt simple interface for me as a dev. * ASIHTTPRequest - I used to swear by it, but now NSURLConnection in Lion (and iOS 5) has async methods with blocks. ASIHTTPRequest doesn't play nicely with ARC because it doesn't have a conventional pattern to object ownership (design to make it less to work to deal by deallocing itself for async usage). * ImageManager - cute, but it's one of many solutions and this one takes some of the cache control out of my hands. I don't believe it resuses ASIHTTPRequest so now I have two HTTP libraries in my project and I'm juggling between both. * The numerous category packages to extend and add convenience methods - these are all cute but I like to take things on a case by case basis and not add code bloat and unused functionality in one shot. The problem that I have is that unlike HTML5 boilerplate which is a common subset of the absolute minimum you are going to need 99% of the time that is put together in the best possible manor, this is just a collection of various packages that you probably will not end up using more than 50% of in most applications. It's not really a "boilerplate" for that reason. Edit: my coworker sent me this when he saw I wrote this reply - http://xkcd.com/386/ http://xkcd.com/386/
- alexbell 15y agoAgreed to a point. It's kind of apples and oranges to compare the HTML5 stuff to iOS, though. Apple provides pretty much all the boilerplate stuff you could ever need with few exceptions. That's not to say nobody should ever try and improve on the Cocoa APIs.
- abijlani 15y agoI agree, it's definitely not boilerplate material but it is certainly a good "starter kit" for a beginner dev, assuming of course that he will need all these libraries for building his app. Otherwise he just downloaded one big bloated project template.
- matttthompson 15y ago
- steipete 15y agoThere are much better choices now, this project is a bit outdated. I'd base a new app on AFNetworking, not asi. ImageManager is not needed, as AFNetworking is better suited. Pull-down-to-refresh is overused already, and most times the wrong context. (Originally, you were loading new tweets ON TOP, not general loading) The whole tableview examples shouldn't be necessary. I wouldn't put maps in a example, most apps aren't gonna use it. JSONKit is great, but also soon iOS4-Legacy. Adding SVProgressHUD only leads to apps that over-use the modal-loading principle, like the GitHub Issues app. The better way is to make a non-obstrusive, non-modal loading inside the controller, which can be cancelled anytime. As for the random categories... meh. Get BlocksKit or something actually useful.
- gimenete 15y agoSVProgressHUD is non-obtrusive. In the example that uses it you can go back, and the HTTP request is cancelled.
- tstyle 15y ago"ImageManager is not needed". As a novice to iOS programming, I'm curious to know what is the preferred way to retrieve and cache remote images and display them in an ImageView. Thanks.
- ThomPete 15y agoThis would be much more interesting for the Android IMHO. Anyone want to work on that and I would be up for it.
- Mizza 15y agoI've been thinking about doing this for a while - I basically have one that I use for my personal projects, but I could clean it up and document it and use make it a public boilerplate. What features would you guys want? Here's what I'd include: * Robust JSON parsing examples feeding to a.. * Speedy list view * Grid and List Menu Views * DataTask examples * Splash screen * Palette values, Gradients in XML * GeoLocation Snippets * Nice defaults for text appearance * Background service example * Internet permissions Anything you guys would want?
- burnstek 15y agoCode to extend the Google Map component (such as a clickable BalloonOverlay, fast OverlayItem grouping). I'd contribute my own code for this to such a project.
- sedev 15y agoAs someone just getting into iOS, this looks very useful, because it's a bunch of coherent ObjC code to read, presented in a beginner-friendly way. I'm also glad I read the HN critiques, though - knowing that some of this will be batteries-included in iOS 5 is valuable.
- Joshim5 15y agoTypo - "It is not intended to be a freamwork"
- gimenete 15y agoThanks. Solved :)
- samyzee 15y agoI stole a few categories from you into my Category Repo.Hope you dont mind. https://samyzee@github.com/samyzee/Additions.git https://samyzee@github.com/samyzee/Additions.git You can add my category repo as a git submodule the boilerplate if you want.I have some cool stuff in there!
- stealingyocode 15y agoI stole a few categories from you into my Category Repo.Hope you dont mind. https://samyzee@github.com/samyzee/Additions https://samyzee@github.com/samyzee/Additions You can add my category repo as a git submodule the boilerplate if you want.I have some cool stuff in there! EDIT:link
- gimenete 15y agoHi, I'm the person behind IOS Boilerplate. I didn't expect to appear at Hacker News. Sorry for the typos, I wrote the web site in less than 1 hour and I didn't check the spelling. This project is work in progress. I'm learning from your comments and I will improve it. I just hope it to be helpful for some of you. I will try to reply to some of your comments directly. Thanks!
- danssig 15y agoInteresting stuff. Does anyone have a "goto" list of IOS libraries documented anywhere? I've heard there's a nice DRM library for IOS apps but I haven't had any luck finding it so far.