diff --git a/Example/DSLCalendarViewExample.xcodeproj/project.pbxproj b/Example/DSLCalendarViewExample.xcodeproj/project.pbxproj index 20ef343..f647e03 100644 --- a/Example/DSLCalendarViewExample.xcodeproj/project.pbxproj +++ b/Example/DSLCalendarViewExample.xcodeproj/project.pbxproj @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ B5294AE615DCF9CF003DB0C2 /* DSLCalendarDayCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = B5294AE515DCF9CF003DB0C2 /* DSLCalendarDayCalloutView.m */; }; B5294AE915DCFA59003DB0C2 /* DSLCalendarDayCalloutView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5294AE815DCFA59003DB0C2 /* DSLCalendarDayCalloutView.xib */; }; + B534035D17B2583100D1204C /* Example.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B534035B17B2583100D1204C /* Example.storyboard */; }; + B534036017B2590A00D1204C /* StoryboardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B534035F17B2590A00D1204C /* StoryboardViewController.m */; }; B5A24DC015D81F3D00F07396 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A24DBF15D81F3D00F07396 /* UIKit.framework */; }; B5A24DC215D81F3D00F07396 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A24DC115D81F3D00F07396 /* Foundation.framework */; }; B5A24DC415D81F3D00F07396 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A24DC315D81F3D00F07396 /* CoreGraphics.framework */; }; @@ -49,6 +51,9 @@ B5294AE415DCF9CF003DB0C2 /* DSLCalendarDayCalloutView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSLCalendarDayCalloutView.h; sourceTree = ""; }; B5294AE515DCF9CF003DB0C2 /* DSLCalendarDayCalloutView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DSLCalendarDayCalloutView.m; sourceTree = ""; }; B5294AE815DCFA59003DB0C2 /* DSLCalendarDayCalloutView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DSLCalendarDayCalloutView.xib; sourceTree = ""; }; + B534035C17B2583100D1204C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/Example.storyboard; sourceTree = ""; }; + B534035E17B2590A00D1204C /* StoryboardViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StoryboardViewController.h; sourceTree = ""; }; + B534035F17B2590A00D1204C /* StoryboardViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoryboardViewController.m; sourceTree = ""; }; B5A24DBB15D81F3D00F07396 /* DSLCalendarViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DSLCalendarViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; B5A24DBF15D81F3D00F07396 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; B5A24DC115D81F3D00F07396 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -152,6 +157,9 @@ B5A24DD115D81F3D00F07396 /* ViewController.h */, B5A24DD215D81F3D00F07396 /* ViewController.m */, B5A24DD415D81F3D00F07396 /* ViewController.xib */, + B534035E17B2590A00D1204C /* StoryboardViewController.h */, + B534035F17B2590A00D1204C /* StoryboardViewController.m */, + B534035B17B2583100D1204C /* Example.storyboard */, B5A24DC615D81F3D00F07396 /* Supporting Files */, ); path = DSLCalendarViewExample; @@ -288,6 +296,7 @@ C15EF2FD1649223900318CE2 /* Icon-57.png in Resources */, C15EF2FF1649230700318CE2 /* Default@2x.png in Resources */, C15EF3011649230A00318CE2 /* Default.png in Resources */, + B534035D17B2583100D1204C /* Example.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -308,12 +317,21 @@ B5A24DF015D81F9A00F07396 /* DSLCalendarMonthSelectorView.m in Sources */, B5294AE615DCF9CF003DB0C2 /* DSLCalendarDayCalloutView.m in Sources */, B5E17D1615DD5F1E003DEDEA /* NSDate+DSLCalendarView.m in Sources */, + B534036017B2590A00D1204C /* StoryboardViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ + B534035B17B2583100D1204C /* Example.storyboard */ = { + isa = PBXVariantGroup; + children = ( + B534035C17B2583100D1204C /* en */, + ); + name = Example.storyboard; + sourceTree = ""; + }; B5A24DC815D81F3D00F07396 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( diff --git a/Example/DSLCalendarViewExample/AppDelegate.h b/Example/DSLCalendarViewExample/AppDelegate.h index c0c1a99..80341c9 100644 --- a/Example/DSLCalendarViewExample/AppDelegate.h +++ b/Example/DSLCalendarViewExample/AppDelegate.h @@ -8,12 +8,8 @@ #import -@class ViewController; - @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; -@property (strong, nonatomic) ViewController *viewController; - @end diff --git a/Example/DSLCalendarViewExample/AppDelegate.m b/Example/DSLCalendarViewExample/AppDelegate.m index d7ec04c..d7349b3 100644 --- a/Example/DSLCalendarViewExample/AppDelegate.m +++ b/Example/DSLCalendarViewExample/AppDelegate.m @@ -12,41 +12,13 @@ @implementation AppDelegate -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - // Override point for customization after application launch. - self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; - self.window.rootViewController = self.viewController; + self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]]; + [self.window makeKeyAndVisible]; - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application -{ - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application -{ - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} -- (void)applicationWillEnterForeground:(UIApplication *)application -{ - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application -{ - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + return YES; } @end diff --git a/Example/DSLCalendarViewExample/StoryboardViewController.h b/Example/DSLCalendarViewExample/StoryboardViewController.h new file mode 100644 index 0000000..28347fa --- /dev/null +++ b/Example/DSLCalendarViewExample/StoryboardViewController.h @@ -0,0 +1,13 @@ +// +// StoryboardViewController.h +// DSLCalendarViewExample +// +// Created by Pete Callaway on 07/08/2013. +// Copyright (c) 2013 Pete Callaway. All rights reserved. +// + +#import "ViewController.h" + +@interface StoryboardViewController : ViewController + +@end diff --git a/Example/DSLCalendarViewExample/StoryboardViewController.m b/Example/DSLCalendarViewExample/StoryboardViewController.m new file mode 100644 index 0000000..1a5e5b1 --- /dev/null +++ b/Example/DSLCalendarViewExample/StoryboardViewController.m @@ -0,0 +1,18 @@ +// +// StoryboardViewController.m +// DSLCalendarViewExample +// +// Created by Pete Callaway on 07/08/2013. +// Copyright (c) 2013 Pete Callaway. All rights reserved. +// + +#import "StoryboardViewController.h" + +@interface StoryboardViewController () + +@end + + +@implementation StoryboardViewController + +@end diff --git a/Example/DSLCalendarViewExample/ViewController.m b/Example/DSLCalendarViewExample/ViewController.m index 9b6487b..b8907f4 100644 --- a/Example/DSLCalendarViewExample/ViewController.m +++ b/Example/DSLCalendarViewExample/ViewController.m @@ -17,22 +17,14 @@ @interface ViewController () @implementation ViewController -- (void)viewDidLoad -{ +- (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. - - self.calendarView.delegate = self; -} -- (void)viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. + self.calendarView.delegate = self; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Storyboard" style:UIBarButtonItemStyleBordered target:self action:@selector(didTapShowStoryboardExample:)]; } -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } @@ -88,4 +80,12 @@ - (BOOL)day:(NSDateComponents*)day1 isBeforeDay:(NSDateComponents*)day2 { return ([day1.date compare:day2.date] == NSOrderedAscending); } + +#pragma mark Actions + +- (void)didTapShowStoryboardExample:(id)sender { + UIViewController *controller = [[UIStoryboard storyboardWithName:@"Example" bundle:nil] instantiateInitialViewController]; + [self.navigationController pushViewController:controller animated:YES]; +} + @end diff --git a/Example/DSLCalendarViewExample/en.lproj/Example.storyboard b/Example/DSLCalendarViewExample/en.lproj/Example.storyboard new file mode 100644 index 0000000..a3fa2d0 --- /dev/null +++ b/Example/DSLCalendarViewExample/en.lproj/Example.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file