Skip to content

Instantly share code, notes, and snippets.

@hartbit
Created September 20, 2012 09:03
Show Gist options
  • Save hartbit/3754787 to your computer and use it in GitHub Desktop.
Save hartbit/3754787 to your computer and use it in GitHub Desktop.
#import "HDAppDelegate.h"
#import "HDViewController.h"
@interface HDAppDelegate ()
@property (nonatomic, strong) HDViewController* viewController;
@end
@implementation HDAppDelegate
@synthesize window = _window;
@synthesize viewController = _viewController;
#pragma mark - Properties
- (UIWindow*)window
{
if (_window == nil)
{
CGRect frame = [[UIScreen mainScreen] bounds];
UIWindow* window = [[UIWindow alloc] initWithFrame:frame];
[self setWindow:window];
[window setRootViewController:[self viewController]];
}
return _window;
}
- (HDViewController*)viewController
{
if (_viewController == nil)
{
HDViewController* viewController = [HDViewController new];
[self setViewController:viewController];
}
return _viewController;
}
#pragma mark - UIApplicationDelegate Methods
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[self window] makeKeyAndVisible];
return YES;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment