From f437f32c0074ab72952e676a1f5b0952fcc45298 Mon Sep 17 00:00:00 2001 From: Manuel Meyer Date: Thu, 20 Dec 2012 18:24:18 +0100 Subject: [PATCH] added -initWithCoder: to KalViewController to make it instantiable from storyboards --- .../SimpelKal.xcodeproj/project.pbxproj | 343 ++++++++++++++++++ .../SimpelKal/SimpelKal/AppDelegate.h | 15 + .../SimpelKal/SimpelKal/AppDelegate.m | 52 +++ .../SimpelKal/SimpelKal/Default-568h@2x.png | Bin 0 -> 18594 bytes .../SimpelKal/SimpelKal/Default.png | Bin 0 -> 6540 bytes .../SimpelKal/SimpelKal/Default@2x.png | Bin 0 -> 16107 bytes .../SimpelKal/SimpelKal/SimpelKal-Info.plist | 38 ++ .../SimpelKal/SimpelKal/SimpelKal-Prefix.pch | 14 + .../SimpelKal/SimpelKal/ViewController.h | 13 + .../SimpelKal/SimpelKal/ViewController.m | 29 ++ .../SimpelKal/en.lproj/InfoPlist.strings | 2 + .../en.lproj/MainStoryboard.storyboard | 25 ++ .../SimpelKal/SimpelKal/main.m | 18 + src/KalLogic.m | 4 +- src/KalViewController.m | 25 +- 15 files changed, 571 insertions(+), 7 deletions(-) create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal.xcodeproj/project.pbxproj create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/AppDelegate.h create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/AppDelegate.m create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/Default-568h@2x.png create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/Default.png create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/Default@2x.png create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/SimpelKal-Info.plist create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/SimpelKal-Prefix.pch create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/ViewController.h create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/ViewController.m create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/en.lproj/InfoPlist.strings create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/en.lproj/MainStoryboard.storyboard create mode 100644 Examples/SampleStoryboard/SimpelKal/SimpelKal/main.m diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal.xcodeproj/project.pbxproj b/Examples/SampleStoryboard/SimpelKal/SimpelKal.xcodeproj/project.pbxproj new file mode 100644 index 0000000..daf6c3a --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal.xcodeproj/project.pbxproj @@ -0,0 +1,343 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 649D968516837595005DAEB2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 649D968416837595005DAEB2 /* UIKit.framework */; }; + 649D968716837595005DAEB2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 649D968616837595005DAEB2 /* Foundation.framework */; }; + 649D968916837595005DAEB2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 649D968816837595005DAEB2 /* CoreGraphics.framework */; }; + 649D968F16837595005DAEB2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 649D968D16837595005DAEB2 /* InfoPlist.strings */; }; + 649D969116837595005DAEB2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 649D969016837595005DAEB2 /* main.m */; }; + 649D969516837595005DAEB2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 649D969416837595005DAEB2 /* AppDelegate.m */; }; + 649D969716837595005DAEB2 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 649D969616837595005DAEB2 /* Default.png */; }; + 649D969916837595005DAEB2 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 649D969816837595005DAEB2 /* Default@2x.png */; }; + 649D969B16837595005DAEB2 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 649D969A16837595005DAEB2 /* Default-568h@2x.png */; }; + 649D969E16837595005DAEB2 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 649D969C16837595005DAEB2 /* MainStoryboard.storyboard */; }; + 649D96A116837595005DAEB2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 649D96A016837595005DAEB2 /* ViewController.m */; }; + 649D96B0168375BC005DAEB2 /* libKal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 649D96AF168375A9005DAEB2 /* libKal.a */; }; + 649D96C116837C66005DAEB2 /* Kal.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 649D96C016837C66005DAEB2 /* Kal.bundle */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 649D96AE168375A9005DAEB2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 649D96A7168375A9005DAEB2 /* Kal.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D2AAC07E0554694100DB518D; + remoteInfo = Kal; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 649D968016837595005DAEB2 /* SimpelKal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpelKal.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 649D968416837595005DAEB2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 649D968616837595005DAEB2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 649D968816837595005DAEB2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 649D968C16837595005DAEB2 /* SimpelKal-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SimpelKal-Info.plist"; sourceTree = ""; }; + 649D968E16837595005DAEB2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 649D969016837595005DAEB2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 649D969216837595005DAEB2 /* SimpelKal-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimpelKal-Prefix.pch"; sourceTree = ""; }; + 649D969316837595005DAEB2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 649D969416837595005DAEB2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 649D969616837595005DAEB2 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + 649D969816837595005DAEB2 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + 649D969A16837595005DAEB2 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 649D969D16837595005DAEB2 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; + 649D969F16837595005DAEB2 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 649D96A016837595005DAEB2 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 649D96A7168375A9005DAEB2 /* Kal.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Kal.xcodeproj; path = ../../../src/Kal.xcodeproj; sourceTree = ""; }; + 649D96C016837C66005DAEB2 /* Kal.bundle */ = {isa = PBXFileReference; lastKnownFileType = file; name = Kal.bundle; path = ../../../src/Kal.bundle; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 649D967D16837595005DAEB2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 649D96B0168375BC005DAEB2 /* libKal.a in Frameworks */, + 649D968516837595005DAEB2 /* UIKit.framework in Frameworks */, + 649D968716837595005DAEB2 /* Foundation.framework in Frameworks */, + 649D968916837595005DAEB2 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 649D967516837595005DAEB2 = { + isa = PBXGroup; + children = ( + 649D968A16837595005DAEB2 /* SimpelKal */, + 649D968316837595005DAEB2 /* Frameworks */, + 649D968116837595005DAEB2 /* Products */, + ); + sourceTree = ""; + }; + 649D968116837595005DAEB2 /* Products */ = { + isa = PBXGroup; + children = ( + 649D968016837595005DAEB2 /* SimpelKal.app */, + ); + name = Products; + sourceTree = ""; + }; + 649D968316837595005DAEB2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 649D96C016837C66005DAEB2 /* Kal.bundle */, + 649D96A7168375A9005DAEB2 /* Kal.xcodeproj */, + 649D968416837595005DAEB2 /* UIKit.framework */, + 649D968616837595005DAEB2 /* Foundation.framework */, + 649D968816837595005DAEB2 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 649D968A16837595005DAEB2 /* SimpelKal */ = { + isa = PBXGroup; + children = ( + 649D969316837595005DAEB2 /* AppDelegate.h */, + 649D969416837595005DAEB2 /* AppDelegate.m */, + 649D969C16837595005DAEB2 /* MainStoryboard.storyboard */, + 649D969F16837595005DAEB2 /* ViewController.h */, + 649D96A016837595005DAEB2 /* ViewController.m */, + 649D968B16837595005DAEB2 /* Supporting Files */, + ); + path = SimpelKal; + sourceTree = ""; + }; + 649D968B16837595005DAEB2 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 649D968C16837595005DAEB2 /* SimpelKal-Info.plist */, + 649D968D16837595005DAEB2 /* InfoPlist.strings */, + 649D969016837595005DAEB2 /* main.m */, + 649D969216837595005DAEB2 /* SimpelKal-Prefix.pch */, + 649D969616837595005DAEB2 /* Default.png */, + 649D969816837595005DAEB2 /* Default@2x.png */, + 649D969A16837595005DAEB2 /* Default-568h@2x.png */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 649D96A8168375A9005DAEB2 /* Products */ = { + isa = PBXGroup; + children = ( + 649D96AF168375A9005DAEB2 /* libKal.a */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 649D967F16837595005DAEB2 /* SimpelKal */ = { + isa = PBXNativeTarget; + buildConfigurationList = 649D96A416837595005DAEB2 /* Build configuration list for PBXNativeTarget "SimpelKal" */; + buildPhases = ( + 649D967C16837595005DAEB2 /* Sources */, + 649D967D16837595005DAEB2 /* Frameworks */, + 649D967E16837595005DAEB2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SimpelKal; + productName = SimpelKal; + productReference = 649D968016837595005DAEB2 /* SimpelKal.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 649D967716837595005DAEB2 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = yourcompany; + }; + buildConfigurationList = 649D967A16837595005DAEB2 /* Build configuration list for PBXProject "SimpelKal" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 649D967516837595005DAEB2; + productRefGroup = 649D968116837595005DAEB2 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 649D96A8168375A9005DAEB2 /* Products */; + ProjectRef = 649D96A7168375A9005DAEB2 /* Kal.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 649D967F16837595005DAEB2 /* SimpelKal */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 649D96AF168375A9005DAEB2 /* libKal.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libKal.a; + remoteRef = 649D96AE168375A9005DAEB2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 649D967E16837595005DAEB2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 649D968F16837595005DAEB2 /* InfoPlist.strings in Resources */, + 649D969716837595005DAEB2 /* Default.png in Resources */, + 649D969916837595005DAEB2 /* Default@2x.png in Resources */, + 649D969B16837595005DAEB2 /* Default-568h@2x.png in Resources */, + 649D969E16837595005DAEB2 /* MainStoryboard.storyboard in Resources */, + 649D96C116837C66005DAEB2 /* Kal.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 649D967C16837595005DAEB2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 649D969116837595005DAEB2 /* main.m in Sources */, + 649D969516837595005DAEB2 /* AppDelegate.m in Sources */, + 649D96A116837595005DAEB2 /* ViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 649D968D16837595005DAEB2 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 649D968E16837595005DAEB2 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 649D969C16837595005DAEB2 /* MainStoryboard.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 649D969D16837595005DAEB2 /* en */, + ); + name = MainStoryboard.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 649D96A216837595005DAEB2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 649D96A316837595005DAEB2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 649D96A516837595005DAEB2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SimpelKal/SimpelKal-Prefix.pch"; + HEADER_SEARCH_PATHS = ../../../src; + INFOPLIST_FILE = "SimpelKal/SimpelKal-Info.plist"; + OTHER_LDFLAGS = "-all_load"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 649D96A616837595005DAEB2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SimpelKal/SimpelKal-Prefix.pch"; + HEADER_SEARCH_PATHS = ../../../src; + INFOPLIST_FILE = "SimpelKal/SimpelKal-Info.plist"; + OTHER_LDFLAGS = "-all_load"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 649D967A16837595005DAEB2 /* Build configuration list for PBXProject "SimpelKal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 649D96A216837595005DAEB2 /* Debug */, + 649D96A316837595005DAEB2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 649D96A416837595005DAEB2 /* Build configuration list for PBXNativeTarget "SimpelKal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 649D96A516837595005DAEB2 /* Debug */, + 649D96A616837595005DAEB2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 649D967716837595005DAEB2 /* Project object */; +} diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/AppDelegate.h b/Examples/SampleStoryboard/SimpelKal/SimpelKal/AppDelegate.h new file mode 100644 index 0000000..7290591 --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// SimpelKal +// +// Created by Manuel Meyer on 20.12.12. +// Copyright (c) 2012 yourcompany. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/AppDelegate.m b/Examples/SampleStoryboard/SimpelKal/SimpelKal/AppDelegate.m new file mode 100644 index 0000000..46c409d --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/AppDelegate.m @@ -0,0 +1,52 @@ +// +// AppDelegate.m +// SimpelKal +// +// Created by Manuel Meyer on 20.12.12. +// Copyright (c) 2012 yourcompany. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate + +- (void)dealloc +{ + [_window release]; + [super dealloc]; +} + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + 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:. +} + +@end diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/Default-568h@2x.png b/Examples/SampleStoryboard/SimpelKal/SimpelKal/Default-568h@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/Default.png b/Examples/SampleStoryboard/SimpelKal/SimpelKal/Default.png new file mode 100644 index 0000000000000000000000000000000000000000..4c8ca6f693f96d511e9113c0eb59eec552354e42 GIT binary patch literal 6540 zcmeAS@N?(olHy`uVBq!ia0y~yU~~ZD2OMlbkt;o0To@QwR5G2N13aCb6#|O#(=u~X z85k@CTSM>X-wqM6>&y>YB4)1;;ojbLbbV-W^iFB1wa3^zCog^LCAReC4K0-?R_2{6 zrP*)4+_uWUy3w5N52M3PW_}MFMP9a~>YLvVZ1D_k*IMQ2QT^fwzoOb(*3gH$%aYWC zkHmcab=va2<#X%jakpJ;<1@F;k__#bwtC&%^D0v(FBh9K&$sK+<}2RJS609D)17$w ztdQP8(eLM8Ka}m_IQ@3wyMKP)l=oM4-?`YS_*P?4V_ORLPxsj&7Ju#kH;>6^Kp?T7~ zl+q?{UOOqV==?+d{=)5s|M~T1mwtH@+Z^$G&eEO9JNP^AX@3jZ*J*!!>lc|1-W%fA z@AOQpXZ_Lt>rxFXrGp*zLPiW@uo_c7C{As>j zWeX)wi+LTp_)@KYZCX{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?t^<46kO#pF-cX0;sIOb(aM z)^jQgX^Z6pKA9mC@N)_aiHj9HxD2|?A@Y9B_h}(*v3%ek8CXc1Qy^jFPF&zrMa1OZ zSVaF{&ZY|(|H0XE&X>-XQz1`=fF2n@VKC_|h3jlKVM&-jmyMavllcYr`6LVtfq2ou zd+8zkkCB+2)rxq0Lkq_&Ad@g(O8;pAm96>tu79?81T@Z<;gm^3ZtPG-SR94Mr<3tm z9NrR3u*4I5aMlo(09g@8m_;%Rf+XiSa_KZao9n}7N0JrsV#;5Ucr+F*TTzQ8{%f3O zeIUy?WDS|-$LvMc@Z7320)tr}bfIka5hx9H;8H|%our=C+Do0CSFRWue14o5#r8v2 zw=|&r4*eMX%lgCV(ka?*j%H^UuP4LmBC(ON`)&7>NF-|PDRU{-7o`CU0HNbd&c~))@yl9IKu_ zXA+A-!khpP_yx=f#qt2_0ptmgBf4gF!{Y)MW6R$cC1d7@$Yb?+_j zYwfE^5_e`vhT zX=u3r>4$fsxP&apbm@Rcbyuc2T=giqZiMo9@9=oua6#YH0hO-1ak9^rJTPMM qY4Yr5Cu^v99p{E9VdroUHKlRW;M8#BJ^AOQE?e9wSHJo8(7yq;BYKSh literal 0 HcmV?d00001 diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/SimpelKal-Info.plist b/Examples/SampleStoryboard/SimpelKal/SimpelKal/SimpelKal-Info.plist new file mode 100644 index 0000000..cee0b4a --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/SimpelKal-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/SimpelKal-Prefix.pch b/Examples/SampleStoryboard/SimpelKal/SimpelKal/SimpelKal-Prefix.pch new file mode 100644 index 0000000..57101d7 --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/SimpelKal-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'SimpelKal' target in the 'SimpelKal' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif \ No newline at end of file diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/ViewController.h b/Examples/SampleStoryboard/SimpelKal/SimpelKal/ViewController.h new file mode 100644 index 0000000..0200175 --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/ViewController.h @@ -0,0 +1,13 @@ +// +// ViewController.h +// SimpelKal +// +// Created by Manuel Meyer on 20.12.12. +// Copyright (c) 2012 yourcompany. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +@end diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/ViewController.m b/Examples/SampleStoryboard/SimpelKal/SimpelKal/ViewController.m new file mode 100644 index 0000000..27b37c4 --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// SimpelKal +// +// Created by Manuel Meyer on 20.12.12. +// Copyright (c) 2012 yourcompany. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/en.lproj/InfoPlist.strings b/Examples/SampleStoryboard/SimpelKal/SimpelKal/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/en.lproj/MainStoryboard.storyboard b/Examples/SampleStoryboard/SimpelKal/SimpelKal/en.lproj/MainStoryboard.storyboard new file mode 100644 index 0000000..3f2c277 --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/en.lproj/MainStoryboard.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Examples/SampleStoryboard/SimpelKal/SimpelKal/main.m b/Examples/SampleStoryboard/SimpelKal/SimpelKal/main.m new file mode 100644 index 0000000..ea9c3ad --- /dev/null +++ b/Examples/SampleStoryboard/SimpelKal/SimpelKal/main.m @@ -0,0 +1,18 @@ +// +// main.m +// SimpelKal +// +// Created by Manuel Meyer on 20.12.12. +// Copyright (c) 2012 yourcompany. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/src/KalLogic.m b/src/KalLogic.m index c15e161..1e9e56f 100644 --- a/src/KalLogic.m +++ b/src/KalLogic.m @@ -47,8 +47,8 @@ - (id)init - (void)moveToMonthForDate:(NSDate *)date { - self.baseDate = [date cc_dateByMovingToFirstDayOfTheMonth]; - [self recalculateVisibleDays]; + self.baseDate = [date cc_dateByMovingToFirstDayOfTheMonth]; + [self recalculateVisibleDays]; } - (void)retreatToPreviousMonth diff --git a/src/KalViewController.m b/src/KalViewController.m index 62245b8..ef4e870 100644 --- a/src/KalViewController.m +++ b/src/KalViewController.m @@ -8,7 +8,7 @@ #import "KalDataSource.h" #import "KalDate.h" #import "KalPrivate.h" - +#import "NSDateAdditions.h" #define PROFILER 0 #if PROFILER #include @@ -40,16 +40,31 @@ @implementation KalViewController @synthesize dataSource, delegate, initialDate, selectedDate; -- (id)initWithSelectedDate:(NSDate *)date +-(void) _configureWithDate:(NSDate *)date { - if ((self = [super init])) { logic = [[KalLogic alloc] initForDate:date]; self.initialDate = date; self.selectedDate = date; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(significantTimeChangeOccurred) name:UIApplicationSignificantTimeChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadData) name:KalDataSourceChangedNotification object:nil]; - } - return self; +} + + +-(id)initWithCoder:(NSCoder *)aDecoder +{ + if ((self = [super initWithCoder:aDecoder])) { + [self _configureWithDate:[NSDate date]]; + } + return self; +} + + +- (id)initWithSelectedDate:(NSDate *)date +{ + if ((self = [super init])) { + [self _configureWithDate:date]; + } + return self; } - (id)init