This project is inspired on HTML5 boilerplate.
iOS Boilerplate is tested on iPhone / iPod Touch devices with iOS 4.0 or greater. In the future it might support universal applications (iPhone + iPad)
At the moment iOS Boilerplate is just an XCode project. Is planned to be released as a true XCode template in the near future.
iOS Boilerplate includes helper classes and examples about the following topics:
iOS Boilerplate includes ASIHTTPRequest
AFNetworking,
a great library for handling HTTP requests. See HTTPHUDExample
to view a simple example of how to use this library.
iOS Boilerplate also includes
AFURLCache that implements both in-memory and in-disk caches (great for images!).
AFURLCache has been developed by steipete.
See AsyncImageExample.m for a basic example on how to load images.
If you are interested in loading async images in a UITableView there is a complete example about async images inside UITableViewCells. See AsyncCellImagesExample.m
Inspired on this article of Atebits
iOS Boilerplate includes a base class for implementing cells with fast scrolling. The base class is
FastCell. There are some examples that extend this class. See
AsyncCellImagesExample, VariableHeightExample and
SwipeableTableCellExample.
iOS Boilerplate includes EGOTableViewPullRefresh but simplifies its use.
You can extend ListViewController.
// This is the core method you should implement
- (void)reloadTableViewDataSource {
_reloading = YES;
// Here you would make an HTTP request or something like that
// Call [self doneLoadingTableViewData] when you are done
[self performSelector:@selector(doneLoadingTableViewData) withObject:nil afterDelay:3.0];
}
You just need to implement something like the above code and initialize the
self.table object. You can initialize it with InterfaceBuilder
(drop a UITableView component and make the link between the outlet and the component).
You should also implement at least the UITableViewDataSource protocol.
For a complete example see PullDownExample.
There is an example of how to implement a swipeable UITableViewCell extending
FastCell. Some code is also needed in the ViewController. See
SwipeableTableViewExample for a complete example.
Thanks to nbuggia you can now open URLs inside your application just opening them as always:
[[UIApplication sharedApplication] openURL:url];
A new viewController will be shown without exiting your app. However, what happens if you really need to open a URL in Safari? No worries, just use this method instead:
[(MyApplication*)[UIApplication sharedApplication] openURL:url forceOpenInSafari:YES];
What if you don't want this to be the default behaviour? What if you want to open
URLs by default in Safari? Just edit
main.m. Put nil instead of @"MyApplication"
And now, to use the built-in web browser explicitly use this:
BrowserViewController *bvc = [[BrowserViewController alloc] initWithUrls:url]; [self.navigationController pushViewController:bvc animated:YES]; [bvc release];
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.
There is an example of how to autocomplete locations using the
Google Maps API.
See AutocompleteLocationExample.m.
iOS Boilerplate includes JSONKit that is a fast library for generating and parsing JSON documents.
iOS Boilerplate includes SVProgressHUD that is
a simple-to-use HUD component. It is used in HTTPHUDExample
This helper class adds some methods to the NSDictionary class. These methods
are usful for safe manipulation of data.
- (NSString*) stringForKey:(id)key; - (NSNumber*) numberForKey:(id)key; - (NSMutableDictionary*) dictionaryForKey:(id)key; - (NSMutableArray*) arrayForKey:(id)key;
These method ensure that the object retrieved is of the desired type, otherwise return nil.
Also NSNull is never returned. These methods are very useful when manipulating
objects returned by JSONKit or any other JSON library.
This helper class adds some methods to the NSString class. The most useful are:
- (NSString*)trim; returns the original NSString but without white spaces at
the beginning or at the end.
- (NSString*)urlEncode; url-encodes the original NSString.
- (NSString*)sha1; calculates the SHA1 of the given NSString.
This helper class adds one method to the NSData class. This method is
- (NSString*)hexString; and returns a NSString in hexadecimal representing
the content of the original NSData object.
QuickDialog allows you to create HIG-compliant iOS forms for your apps without having to directly deal with UITableViews, delegates and data sources. Fast and efficient, you can create forms with multiple text fields, or with thousands of items with no sweat!
IBAForms is a framework for building data entry screens on the iPhone. You can quickly make forms using the built-in form field types or create your own custom fields and the user interfaces used to enter data for them
PSStackedView: put your UIViewControllers in a stack, inspired by Twitter's iPAD UI
CocoaControls Custom UI Controls for iOS and Mac OS X
iOS Frameworks A curated catalog of iOS frameworks and classes for the pragmatic iOS developer