SDScaffoldKit

Scaffolding for your Core Data Models

217
14
Objective-C

SDScaffoldKit

###Check out SDScaffoldSync- Create a cloud syncing mobile app in 3 minutes.

SDScaffoldSync- Create a Cloud Syncing Mobile App in 3 Minutes

Scaffolding for Core Data Models

UIKit can be tedious and repeative to build simple CRUD interfaces. SDScaffoldKit is a simple library that provides Create, Read, Update, and Delete views/viewcontrollers out-of-the-box. Just create your Core Data model, hand it your Entity’s name, a field to sort by, and BAM! You are ready to start creating and managing objects.

SDScaffoldKit is named after Ruby on Rails’s scaffolding.

SDScaffoldingKit 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 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.

If you enjoy this project, I would encourage you to check out Mattt Thompson’s 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.

Getting Started

Create Core Data Models

  1. Add CoreData.framework into your project
  2. Create Core Data Model
  3. #import "SDScaffoldKit.h" and create an instance with desginated initializer initWithEntityName:sortBy:context:andStyle:
  SDScaffoldIndexViewController *scaffoldViewController = [[SDScaffoldIndexViewController alloc] 
    initWithEntityName:@"User" sortBy:@"lastname" context:[self managedObjectContext] andStyle:UITableViewStyleGrouped];

Then wrap your SDScaffoldIndexViewController instance in a UINavigationController

 UINavigationController *navController = [[UINavigationController alloc] 
    initWithRootViewController:scaffoldViewController];

Done!

Example Usage

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
     // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
   
    SDScaffoldIndexViewController *scaffoldViewController = [[SDScaffoldIndexViewController alloc] initWithEntityName:@"User" 
     sortBy:@"lastname" context:[self managedObjectContext]];
    
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:scaffoldViewController];
  
    self.window.rootViewController = navController;
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    
    return YES;
}

Sample Images

User Index Index
Add User Create
Show User Show
Edit User Update
Delete User Delete

Contact

Steve Derico

License

SDScaffoldKit is available under the MIT license. See the LICENSE file for more info.