Git Product home page Git Product logo

sdscaffoldsync's Introduction

AFNetworking + AFIncrementalStore + SDScaffoldKit = SDScaffoldSync

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

SDScaffoldSync

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 -

  1. Install CocoaPods
  2. Create New Project with AFNetworking Xcode Template
  3. Close current project. cd to PROJECTNAME directory then
  4. Run pod install
  5. Run open PROJECTNAME.xcworkspace
  6. Create ENTITYNAME in PROJECTNAME.xcdatamodeld file
  7. Run git commit -a -m "first commit"
  8. Run heroku create --buildpack git://github.com/mattt/heroku-buildpack-core-data.git
  9. Run git push heroku master
  10. Copy random-name-here.herokuapp.com url from terminal, set kAPIBaseURLString in PROJECTNAMEAPIClient.m to random-name-here.herokuapp.com url.
  11. Add SDScaffoldKit to project. Then add #import "SDScaffoldKit.h" to PROJECTNAME-Prefix.pch
  12. Create SDScaffoldIndexViewController instance and set it to the rootViewController of the main navigationController.
  13. 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;
}
  1. Open http://random-name-here.herokuapp.com/MODELNAMEs in your browser i.e. http://sleepy-eyrie-2619.herokuapp.com/runs
  2. Build and Run Xcode App
  3. Follow @stevederico on twitter, tell me what you think.
  4. Watch refactor.tv, a podcast with Sam Soffes, where we cover iOS and Open-source projects each week.

Twitter image

Common Errors

  • Don't forget to change the build target from Pods. Click Pods next to the Stop button and change to PROJECTNAME, then Run. Bad Good

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.com url - Heroku webserver url i.e. http://sleepy-eyrie-2619.herokuapp.com

Thanks

  • Thanks to @mattt for all his wonderful work.

sdscaffoldsync's People

Contributors

stevederico avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.