AFNetworking + AFIncrementalStore + SDScaffoldKit = SDScaffoldSync
=======
This Project Would Not Be Possible Without Mattt Thompson.
SDScaffoldSync is a combination of SDScaffoldKit, AFNetworking, and AFIncrementalStore using the Heroku-Core-Data-Buildback. SDScaffoldSync was inspired by Build an iOS App in 10 Minutes with AFIncrementalStore and the Core Data Buildpack Without these contributions from Mattt, none of this would be possible. I highly encourage everyone to follow & thank Mattt Thompson for his series of open source libraries covering the mission-critical aspects of an iOS app's infrastructure. Be sure to check out its sister projects: GroundControl, SkyLab, CargoBay, and houston.
##Create a Cloud Syncing Mobile App in 3 Minutes
Building an app that syncs its data in the cloud can be difficult. That's where SDScaffoldSync comes into play. SDScaffoldSync creates a REST endpoint (via Heroku-Core-Data-Buildpack) and syncing code (via AFIncrementalStore) for you. SDScaffoldSync also leverages SDScaffoldKit to give you ready-made views for your model objects.
Just create your Core Data model, hand SDScaffoldKit your Entity's name, a field to sort by, and BAM! You you have a cloud syncing app.
SDScaffoldSync is meant to save you time so you can focus on what matters, application logic. The library is still a little green behind the ears and I would love to see any issues or pull request you may have. There is a sample project and screencast if you have any question on how it all works.
Overall, this is a great way to get your project up and running then you can go from there.
Watch Screencast Video: https://vimeo.com/59389685
Getting Started
These are the exact steps needed to take to create an syncing client-server app in 3 minutes. You will need to have CocoaPods Installed on your machine. Watch this video for a complete demo -
- Install CocoaPods
- Create New Project with AFNetworking Xcode Template
- Close current project.
cdtoPROJECTNAMEdirectory then - Run
pod install - Run
open PROJECTNAME.xcworkspace - Create
ENTITYNAMEinPROJECTNAME.xcdatamodeldfile - Run
git commit -a -m "first commit" - Run
heroku create --buildpack git://github.com/mattt/heroku-buildpack-core-data.git - Run
git push heroku master - Copy
random-name-here.herokuapp.comurl from terminal, setkAPIBaseURLStringinPROJECTNAMEAPIClient.mtorandom-name-here.herokuapp.comurl. - Add SDScaffoldKit to project. Then add
#import "SDScaffoldKit.h"toPROJECTNAME-Prefix.pch - Create
SDScaffoldIndexViewControllerinstance and set it to therootViewControllerof the mainnavigationController. - App Delegate should look like this:
- (BOOL)application:(UIApplication *)applicationdidFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:8 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil]; [NSURLCache setSharedURLCache:URLCache]; [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; SDScaffoldIndexViewController *scaffoldViewController = [[SDScaffoldIndexViewController alloc] initWithEntityName:@"ENTITYNAME" sortBy:@"PROPERTY" context:self.managedObjectContext]; self.navigationController = [[UINavigationController alloc] initWithRootViewController:scaffoldViewController]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = self.navigationController; [self.window makeKeyAndVisible]; return YES; }
- Open http://random-name-here.herokuapp.com/MODELNAMEs in your browser i.e. http://sleepy-eyrie-2619.herokuapp.com/runs
- Build and Run Xcode App
- Follow @stevederico on twitter, tell me what you think.
- Watch refactor.tv, a podcast with Sam Soffes, where we cover iOS and Open-source projects each week.
Common Errors
Legend
PROJECTNAME- Full name of the Project i.e. "RunLog"ENTITYNAME- Core Data Model Entity Name i.e. "Run"PROPERTY- An attribute of the new Entity i.e "summary"random-name-here.herokuapp.comurl - Heroku webserver url i.e. http://sleepy-eyrie-2619.herokuapp.com
Thanks
- Thanks to @mattt for all his wonderful work.


