Latest 0.1.0
Homepage https://github.com/SergioEstevao/SVEApplicationDelegate
License MIT
Platforms ios , requires ARC
Frameworks UIKit
Authors

SVEApplicationDelegate Build Status

A service oriented ApplicationDelegate. Check the rational for this approach here.

SVEApplicationDelegate is tested on iOS 5 and requires ARC. Released under the MIT license.

Example

Open up the included Xcode project for an example app and the tests.

Usage

On your ApplicationDelegate .h file inherit from SVEApplication Delegate.

#import "SVEApplicationDelegate.h"

@interface AppDelegate : SVEApplicationDelegate

@end

Then in your ApplicationDelegate .m file just add the services you need and just configure your Root Controller and you are done.

- (NSArray *) services {
    static NSArray * _services;
    static dispatch_once_t _onceTokenServices;
    dispatch_once(&_onceTokenServices, ^{
        _services = @[[DataController sharedInstance], [PushNotificationController sharedInstance], [LocationController sharedInstance]];
    });
    return _services;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Invoke super to startup all the services
    [super application:application didFinishLaunchingWithOptions:launchOptions];

    // Setup the view controllers
    UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
    MasterViewController *controller = (MasterViewController *)navigationController.topViewController;
    controller.managedObjectContext = [DataController sharedInstance].managedObjectContext;

    return YES;
}

See the header for full documentation.

Installation

Simply add the files in the SVEApplicationDelegate.h and SVEApplicationDelegate.m to your project or add SVEApplicationDelegate to your Podfile if you’re using CocoaPods.

Latest podspec

{
    "name": "SVEApplicationDelegate",
    "version": "0.1.0",
    "authors": {
        "Su00e9rgio Estu00eavu00e3o": "[email protected]"
    },
    "homepage": "https://github.com/SergioEstevao/SVEApplicationDelegate",
    "summary": "A service oriented ApplicationDelegate",
    "source": {
        "git": "https://github.com/SergioEstevao/SVEApplicationDelegate.git",
        "tag": "v0.1.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": null
    },
    "requires_arc": true,
    "frameworks": "UIKit",
    "source_files": "SVEApplicationDelegate"
}

Pin It on Pinterest

Share This