diff --git a/Time/Time.xcodeproj/project.pbxproj b/Time/Time.xcodeproj/project.pbxproj index c8743f0..5287044 100644 --- a/Time/Time.xcodeproj/project.pbxproj +++ b/Time/Time.xcodeproj/project.pbxproj @@ -7,13 +7,35 @@ objects = { /* Begin PBXBuildFile section */ + 4D5C83D01B90EE7B0021A55C /* Bokeh.sks in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83CE1B90EE7B0021A55C /* Bokeh.sks */; }; + 4D5C83D11B90EE7B0021A55C /* bokeh.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83CF1B90EE7B0021A55C /* bokeh.png */; }; + 4D5C83D41B90EF620021A55C /* BokehScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D5C83D31B90EF620021A55C /* BokehScene.m */; }; + 4D5C83DD1B9104930021A55C /* ticker1.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83D51B9104930021A55C /* ticker1.png */; }; + 4D5C83DE1B9104930021A55C /* ticker2.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83D61B9104930021A55C /* ticker2.png */; }; + 4D5C83DF1B9104930021A55C /* ticker3.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83D71B9104930021A55C /* ticker3.png */; }; + 4D5C83E01B9104930021A55C /* ticker4.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83D81B9104930021A55C /* ticker4.png */; }; + 4D5C83E11B9104930021A55C /* ticker5.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83D91B9104930021A55C /* ticker5.png */; }; + 4D5C83E21B9104930021A55C /* ticker6.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83DA1B9104930021A55C /* ticker6.png */; }; + 4D5C83E31B9104930021A55C /* ticker7.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83DB1B9104930021A55C /* ticker7.png */; }; + 4D5C83E41B9104930021A55C /* ticker8.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83DC1B9104930021A55C /* ticker8.png */; }; + 4D5C83E81B91117B0021A55C /* Akkurat Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83E71B91117A0021A55C /* Akkurat Regular.otf */; }; + 4D5C83EA1B9112E50021A55C /* Akkurat Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 4D5C83E91B9112E50021A55C /* Akkurat Bold.otf */; }; + 4DD581521B8A3038006FE339 /* PresetEventCountdownViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DD581511B8A3038006FE339 /* PresetEventCountdownViewController.m */; }; + 4DD581551B8A316E006FE339 /* PresetTimerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DD581541B8A316E006FE339 /* PresetTimerViewController.m */; }; 8D05375E1B86687C00588318 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D05375D1B86687C00588318 /* main.m */; }; 8D0537611B86687C00588318 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D0537601B86687C00588318 /* AppDelegate.m */; }; - 8D0537641B86687C00588318 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D0537631B86687C00588318 /* ViewController.m */; }; 8D0537671B86687C00588318 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8D0537651B86687C00588318 /* Main.storyboard */; }; 8D0537691B86687C00588318 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8D0537681B86687C00588318 /* Images.xcassets */; }; 8D05376C1B86687C00588318 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8D05376A1B86687C00588318 /* LaunchScreen.xib */; }; 8D0537781B86687C00588318 /* TimeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D0537771B86687C00588318 /* TimeTests.m */; }; + D9DEC6221B97293400DDE698 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9DEC6211B97293400DDE698 /* AVFoundation.framework */; }; + D9DEC6241B97295F00DDE698 /* ping-sound.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = D9DEC6231B97295F00DDE698 /* ping-sound.mp3 */; }; + D9E4BBD11B9243760001CC08 /* PresetTimerDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E4BBD01B9243760001CC08 /* PresetTimerDetailViewController.m */; }; + D9E4BBD41B9243C20001CC08 /* PresetTimerAddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E4BBD31B9243C20001CC08 /* PresetTimerAddViewController.m */; }; + D9E4BBD71B924DC10001CC08 /* Timer.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E4BBD61B924DC10001CC08 /* Timer.m */; }; + D9E4BBDA1B924DE10001CC08 /* TimerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E4BBD91B924DE10001CC08 /* TimerModel.m */; }; + D9F01CF81B88C4C3000B02E1 /* StopWatchTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9F01CF71B88C4C3000B02E1 /* StopWatchTabBarController.m */; }; + D9F01CFB1B88C4DD000B02E1 /* TimerTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9F01CFA1B88C4DD000B02E1 /* TimerTabBarController.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -27,19 +49,49 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 4D5C83CE1B90EE7B0021A55C /* Bokeh.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Bokeh.sks; sourceTree = ""; }; + 4D5C83CF1B90EE7B0021A55C /* bokeh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bokeh.png; sourceTree = ""; }; + 4D5C83D21B90EF620021A55C /* BokehScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BokehScene.h; sourceTree = ""; }; + 4D5C83D31B90EF620021A55C /* BokehScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BokehScene.m; sourceTree = ""; }; + 4D5C83D51B9104930021A55C /* ticker1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ticker1.png; sourceTree = ""; }; + 4D5C83D61B9104930021A55C /* ticker2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ticker2.png; sourceTree = ""; }; + 4D5C83D71B9104930021A55C /* ticker3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ticker3.png; sourceTree = ""; }; + 4D5C83D81B9104930021A55C /* ticker4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ticker4.png; sourceTree = ""; }; + 4D5C83D91B9104930021A55C /* ticker5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ticker5.png; sourceTree = ""; }; + 4D5C83DA1B9104930021A55C /* ticker6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ticker6.png; sourceTree = ""; }; + 4D5C83DB1B9104930021A55C /* ticker7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ticker7.png; sourceTree = ""; }; + 4D5C83DC1B9104930021A55C /* ticker8.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ticker8.png; sourceTree = ""; }; + 4D5C83E71B91117A0021A55C /* Akkurat Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Akkurat Regular.otf"; sourceTree = ""; }; + 4D5C83E91B9112E50021A55C /* Akkurat Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Akkurat Bold.otf"; sourceTree = ""; }; + 4DD581501B8A3038006FE339 /* PresetEventCountdownViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PresetEventCountdownViewController.h; sourceTree = ""; }; + 4DD581511B8A3038006FE339 /* PresetEventCountdownViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresetEventCountdownViewController.m; sourceTree = ""; }; + 4DD581531B8A316E006FE339 /* PresetTimerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PresetTimerViewController.h; sourceTree = ""; }; + 4DD581541B8A316E006FE339 /* PresetTimerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresetTimerViewController.m; sourceTree = ""; }; 8D0537581B86687B00588318 /* Time.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Time.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8D05375C1B86687B00588318 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D05375D1B86687C00588318 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 8D05375F1B86687C00588318 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 8D0537601B86687C00588318 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8D0537621B86687C00588318 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 8D0537631B86687C00588318 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 8D0537661B86687C00588318 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 8D0537681B86687C00588318 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 8D05376B1B86687C00588318 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 8D0537711B86687C00588318 /* TimeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TimeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8D0537761B86687C00588318 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D0537771B86687C00588318 /* TimeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TimeTests.m; sourceTree = ""; }; + D9DEC6211B97293400DDE698 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + D9DEC6231B97295F00DDE698 /* ping-sound.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "ping-sound.mp3"; sourceTree = ""; }; + D9E4BBCF1B9243760001CC08 /* PresetTimerDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PresetTimerDetailViewController.h; sourceTree = ""; }; + D9E4BBD01B9243760001CC08 /* PresetTimerDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresetTimerDetailViewController.m; sourceTree = ""; }; + D9E4BBD21B9243C20001CC08 /* PresetTimerAddViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PresetTimerAddViewController.h; sourceTree = ""; }; + D9E4BBD31B9243C20001CC08 /* PresetTimerAddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresetTimerAddViewController.m; sourceTree = ""; }; + D9E4BBD51B924DC10001CC08 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = ""; }; + D9E4BBD61B924DC10001CC08 /* Timer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Timer.m; sourceTree = ""; }; + D9E4BBD81B924DE10001CC08 /* TimerModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimerModel.h; sourceTree = ""; }; + D9E4BBD91B924DE10001CC08 /* TimerModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TimerModel.m; sourceTree = ""; }; + D9F01CF61B88C4C3000B02E1 /* StopWatchTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StopWatchTabBarController.h; sourceTree = ""; }; + D9F01CF71B88C4C3000B02E1 /* StopWatchTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StopWatchTabBarController.m; sourceTree = ""; }; + D9F01CF91B88C4DD000B02E1 /* TimerTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimerTabBarController.h; sourceTree = ""; }; + D9F01CFA1B88C4DD000B02E1 /* TimerTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TimerTabBarController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -47,6 +99,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D9DEC6221B97293400DDE698 /* AVFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -63,6 +116,7 @@ 8D05374F1B86687B00588318 = { isa = PBXGroup; children = ( + D9DEC6211B97293400DDE698 /* AVFoundation.framework */, 8D05375A1B86687B00588318 /* Time */, 8D0537741B86687C00588318 /* TimeTests */, 8D0537591B86687B00588318 /* Products */, @@ -83,8 +137,26 @@ children = ( 8D05375F1B86687C00588318 /* AppDelegate.h */, 8D0537601B86687C00588318 /* AppDelegate.m */, - 8D0537621B86687C00588318 /* ViewController.h */, - 8D0537631B86687C00588318 /* ViewController.m */, + D9E4BBD51B924DC10001CC08 /* Timer.h */, + D9E4BBD61B924DC10001CC08 /* Timer.m */, + D9E4BBD81B924DE10001CC08 /* TimerModel.h */, + D9E4BBD91B924DE10001CC08 /* TimerModel.m */, + D9F01CF61B88C4C3000B02E1 /* StopWatchTabBarController.h */, + D9F01CF71B88C4C3000B02E1 /* StopWatchTabBarController.m */, + D9F01CF91B88C4DD000B02E1 /* TimerTabBarController.h */, + D9F01CFA1B88C4DD000B02E1 /* TimerTabBarController.m */, + 4DD581531B8A316E006FE339 /* PresetTimerViewController.h */, + 4DD581541B8A316E006FE339 /* PresetTimerViewController.m */, + D9E4BBCF1B9243760001CC08 /* PresetTimerDetailViewController.h */, + D9E4BBD01B9243760001CC08 /* PresetTimerDetailViewController.m */, + D9E4BBD21B9243C20001CC08 /* PresetTimerAddViewController.h */, + D9E4BBD31B9243C20001CC08 /* PresetTimerAddViewController.m */, + 4DD581501B8A3038006FE339 /* PresetEventCountdownViewController.h */, + 4DD581511B8A3038006FE339 /* PresetEventCountdownViewController.m */, + 4D5C83D21B90EF620021A55C /* BokehScene.h */, + 4D5C83D31B90EF620021A55C /* BokehScene.m */, + 4D5C83CE1B90EE7B0021A55C /* Bokeh.sks */, + 4D5C83CF1B90EE7B0021A55C /* bokeh.png */, 8D0537651B86687C00588318 /* Main.storyboard */, 8D0537681B86687C00588318 /* Images.xcassets */, 8D05376A1B86687C00588318 /* LaunchScreen.xib */, @@ -96,6 +168,17 @@ 8D05375B1B86687B00588318 /* Supporting Files */ = { isa = PBXGroup; children = ( + D9DEC6231B97295F00DDE698 /* ping-sound.mp3 */, + 4D5C83E71B91117A0021A55C /* Akkurat Regular.otf */, + 4D5C83E91B9112E50021A55C /* Akkurat Bold.otf */, + 4D5C83D51B9104930021A55C /* ticker1.png */, + 4D5C83D61B9104930021A55C /* ticker2.png */, + 4D5C83D71B9104930021A55C /* ticker3.png */, + 4D5C83D81B9104930021A55C /* ticker4.png */, + 4D5C83D91B9104930021A55C /* ticker5.png */, + 4D5C83DA1B9104930021A55C /* ticker6.png */, + 4D5C83DB1B9104930021A55C /* ticker7.png */, + 4D5C83DC1B9104930021A55C /* ticker8.png */, 8D05375C1B86687B00588318 /* Info.plist */, 8D05375D1B86687C00588318 /* main.m */, ); @@ -163,11 +246,12 @@ 8D0537501B86687B00588318 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0640; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Mike Kavouras"; TargetAttributes = { 8D0537571B86687B00588318 = { CreatedOnToolsVersion = 6.4; + DevelopmentTeam = 5F2A5ZZ575; }; 8D0537701B86687C00588318 = { CreatedOnToolsVersion = 6.4; @@ -199,9 +283,22 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + D9DEC6241B97295F00DDE698 /* ping-sound.mp3 in Resources */, + 4D5C83D11B90EE7B0021A55C /* bokeh.png in Resources */, 8D0537671B86687C00588318 /* Main.storyboard in Resources */, + 4D5C83DE1B9104930021A55C /* ticker2.png in Resources */, + 4D5C83E31B9104930021A55C /* ticker7.png in Resources */, + 4D5C83E01B9104930021A55C /* ticker4.png in Resources */, + 4D5C83DF1B9104930021A55C /* ticker3.png in Resources */, + 4D5C83E11B9104930021A55C /* ticker5.png in Resources */, + 4D5C83EA1B9112E50021A55C /* Akkurat Bold.otf in Resources */, + 4D5C83D01B90EE7B0021A55C /* Bokeh.sks in Resources */, + 4D5C83DD1B9104930021A55C /* ticker1.png in Resources */, + 4D5C83E81B91117B0021A55C /* Akkurat Regular.otf in Resources */, 8D05376C1B86687C00588318 /* LaunchScreen.xib in Resources */, 8D0537691B86687C00588318 /* Images.xcassets in Resources */, + 4D5C83E21B9104930021A55C /* ticker6.png in Resources */, + 4D5C83E41B9104930021A55C /* ticker8.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -219,9 +316,17 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8D0537641B86687C00588318 /* ViewController.m in Sources */, + 4DD581521B8A3038006FE339 /* PresetEventCountdownViewController.m in Sources */, + 4D5C83D41B90EF620021A55C /* BokehScene.m in Sources */, 8D0537611B86687C00588318 /* AppDelegate.m in Sources */, 8D05375E1B86687C00588318 /* main.m in Sources */, + D9E4BBD41B9243C20001CC08 /* PresetTimerAddViewController.m in Sources */, + D9E4BBD71B924DC10001CC08 /* Timer.m in Sources */, + 4DD581551B8A316E006FE339 /* PresetTimerViewController.m in Sources */, + D9F01CF81B88C4C3000B02E1 /* StopWatchTabBarController.m in Sources */, + D9E4BBD11B9243760001CC08 /* PresetTimerDetailViewController.m in Sources */, + D9E4BBDA1B924DE10001CC08 /* TimerModel.m in Sources */, + D9F01CFB1B88C4DD000B02E1 /* TimerTabBarController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -284,6 +389,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -349,9 +455,13 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = Time/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.xiulanshi.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Debug; }; @@ -359,9 +469,13 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = Time/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.xiulanshi.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Release; }; @@ -379,6 +493,7 @@ ); INFOPLIST_FILE = TimeTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mikekavouras.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Time.app/Time"; }; @@ -394,6 +509,7 @@ ); INFOPLIST_FILE = TimeTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mikekavouras.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Time.app/Time"; }; @@ -418,6 +534,7 @@ 8D05377D1B86687C00588318 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 8D05377E1B86687C00588318 /* Build configuration list for PBXNativeTarget "TimeTests" */ = { isa = XCConfigurationList; @@ -426,6 +543,7 @@ 8D0537801B86687C00588318 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Time/Time/Akkurat Bold.otf b/Time/Time/Akkurat Bold.otf new file mode 100644 index 0000000..13076b6 Binary files /dev/null and b/Time/Time/Akkurat Bold.otf differ diff --git a/Time/Time/Akkurat Regular.otf b/Time/Time/Akkurat Regular.otf new file mode 100644 index 0000000..a967332 Binary files /dev/null and b/Time/Time/Akkurat Regular.otf differ diff --git a/Time/Time/AppDelegate.m b/Time/Time/AppDelegate.m index d59e7a8..8902aa7 100644 --- a/Time/Time/AppDelegate.m +++ b/Time/Time/AppDelegate.m @@ -16,7 +16,29 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. + + // remove translucent layer on navigation items + [UINavigationBar appearance].translucent = NO; + [UITabBar appearance].translucent = NO; + + //[UITabBar appearance].backgroundColor = [UIColor blueColor]; + + // change tab bar controller background color + UINavigationController *nav = (UINavigationController *)self.window.rootViewController; + UITabBarController *bc = nav.viewControllers[0]; + //bc.tabBar.barTintColor = [UIColor colorWithRed:235/256.0 green:235/256.0 blue:241/256.0 alpha:1.0]; // grey + bc.tabBar.barTintColor = [UIColor colorWithRed:249/256.0 green:205/256.0 blue:78/256.0 alpha:1.0]; // yellow + + // change header navigation bar background color + //[UINavigationBar appearance].barTintColor = [UIColor colorWithRed:235/256.0 green:235/256.0 blue:241/256.0 alpha:1.0]; // grey + [UINavigationBar appearance].barTintColor = [UIColor colorWithRed:249/256.0 green:205/256.0 blue:78/256.0 alpha:1.0]; // yellow + + // change top navigation bar button color + [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; + + self.window.backgroundColor = [UIColor groupTableViewBackgroundColor]; + + return YES; } diff --git a/Time/Time/Base.lproj/LaunchScreen.xib b/Time/Time/Base.lproj/LaunchScreen.xib index f9a54ff..0c8db40 100644 --- a/Time/Time/Base.lproj/LaunchScreen.xib +++ b/Time/Time/Base.lproj/LaunchScreen.xib @@ -1,7 +1,7 @@ - + - + diff --git a/Time/Time/Base.lproj/Main.storyboard b/Time/Time/Base.lproj/Main.storyboard index f56d2f3..163887f 100644 --- a/Time/Time/Base.lproj/Main.storyboard +++ b/Time/Time/Base.lproj/Main.storyboard @@ -1,25 +1,956 @@ - + - + + + + + + + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + Akkurat-Bold + + + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + Akkurat + + - - + + - + - - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Time/Time/Bokeh.sks b/Time/Time/Bokeh.sks new file mode 100644 index 0000000..7ffa34c Binary files /dev/null and b/Time/Time/Bokeh.sks differ diff --git a/Time/Time/BokehScene.h b/Time/Time/BokehScene.h new file mode 100644 index 0000000..46562fe --- /dev/null +++ b/Time/Time/BokehScene.h @@ -0,0 +1,14 @@ +// +// BokehScene.h +// Time +// +// Created by Shena Yoshida on 8/28/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import +@import SpriteKit; // create module + +@interface BokehScene : SKScene + +@end diff --git a/Time/Time/BokehScene.m b/Time/Time/BokehScene.m new file mode 100644 index 0000000..cfe91b0 --- /dev/null +++ b/Time/Time/BokehScene.m @@ -0,0 +1,28 @@ +// +// BokehScene.m +// Time +// +// Created by Shena Yoshida on 8/28/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "BokehScene.h" + +@implementation BokehScene + +-(id)initWithSize:(CGSize)size { + if (self = [super initWithSize:size]) { + //self.backgroundColor = [SKColor blackColor]; + self.scene.backgroundColor = [SKColor colorWithRed:251/255.0f green:207/255.0f blue:79/255.0f alpha:1.0]; + + NSString *emitterPath = [[NSBundle mainBundle] pathForResource:@"Bokeh" ofType:@"sks"]; + SKEmitterNode *bokeh = [NSKeyedUnarchiver unarchiveObjectWithFile:emitterPath]; + bokeh.position = CGPointMake(CGRectGetMidX(self.frame), self.size.height/2); + bokeh.name = @"particleBokeh"; + bokeh.targetNode = self.scene; + [self addChild:bokeh]; + } + return self; +} + +@end diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/Contents.json b/Time/Time/Images.xcassets/AppIcon.appiconset/Contents.json index 36d2c80..6acc32f 100644 --- a/Time/Time/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Time/Time/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,63 +1,117 @@ { "images" : [ { + "size" : "29x29", "idiom" : "iphone", + "filename" : "icon7.png", + "scale" : "1x" + }, + { "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon1.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon2.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon3.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon4.png", "scale" : "3x" }, { + "size" : "57x57", "idiom" : "iphone", - "size" : "60x60", + "filename" : "icon8.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "icon9.png", "scale" : "2x" }, { + "size" : "60x60", "idiom" : "iphone", + "filename" : "icon5.png", + "scale" : "2x" + }, + { "size" : "60x60", + "idiom" : "iphone", + "filename" : "iTunesArtwork@2x copy 7.png", "scale" : "3x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon7-1.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon8-1.png", "scale" : "2x" }, { + "size" : "40x40", "idiom" : "ipad", + "filename" : "icon40px copy.png", + "scale" : "1x" + }, + { "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon80px-1.png", + "scale" : "2x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "icon50px.png", "scale" : "1x" }, { + "size" : "50x50", "idiom" : "ipad", - "size" : "40x40", + "filename" : "icon100px.png", "scale" : "2x" }, { + "size" : "72x72", "idiom" : "ipad", - "size" : "76x76", + "filename" : "icon72px.png", "scale" : "1x" }, { + "size" : "72x72", "idiom" : "ipad", + "filename" : "icon144px.png", + "scale" : "2x" + }, + { "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon152.png", "scale" : "2x" } ], diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/iTunesArtwork@2x copy 7.png b/Time/Time/Images.xcassets/AppIcon.appiconset/iTunesArtwork@2x copy 7.png new file mode 100644 index 0000000..3527145 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/iTunesArtwork@2x copy 7.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon1.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon1.png new file mode 100644 index 0000000..c28bf3c Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon1.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon100px.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon100px.png new file mode 100644 index 0000000..e12d234 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon100px.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon144px.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon144px.png new file mode 100644 index 0000000..ef8a702 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon144px.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon152.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon152.png new file mode 100644 index 0000000..9a6f9d6 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon152.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon2.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon2.png new file mode 100644 index 0000000..66e515e Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon2.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon3.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon3.png new file mode 100644 index 0000000..7e94fd2 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon3.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon4.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon4.png new file mode 100644 index 0000000..105a03b Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon4.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon40px copy.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon40px copy.png new file mode 100644 index 0000000..9d7dad4 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon40px copy.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon5.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon5.png new file mode 100644 index 0000000..105a03b Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon5.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon50px.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon50px.png new file mode 100644 index 0000000..c460eec Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon50px.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon7-1.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon7-1.png new file mode 100644 index 0000000..c4cc924 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon7-1.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon7.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon7.png new file mode 100644 index 0000000..c4cc924 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon7.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon72px.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon72px.png new file mode 100644 index 0000000..0381d74 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon72px.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon76.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon76.png new file mode 100644 index 0000000..9a6f9d6 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon76.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon8-1.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon8-1.png new file mode 100644 index 0000000..7314b44 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon8-1.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon8.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon8.png new file mode 100644 index 0000000..7314b44 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon8.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon80px-1.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon80px-1.png new file mode 100644 index 0000000..55eba14 Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon80px-1.png differ diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/icon9.png b/Time/Time/Images.xcassets/AppIcon.appiconset/icon9.png new file mode 100644 index 0000000..76e2c7f Binary files /dev/null and b/Time/Time/Images.xcassets/AppIcon.appiconset/icon9.png differ diff --git a/Time/Time/Images.xcassets/Banana Cupcakes.imageset/Contents.json b/Time/Time/Images.xcassets/Banana Cupcakes.imageset/Contents.json new file mode 100644 index 0000000..3fd86e5 --- /dev/null +++ b/Time/Time/Images.xcassets/Banana Cupcakes.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Cupcake-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Banana Cupcakes.imageset/Cupcake-icon.png b/Time/Time/Images.xcassets/Banana Cupcakes.imageset/Cupcake-icon.png new file mode 100644 index 0000000..47ace73 Binary files /dev/null and b/Time/Time/Images.xcassets/Banana Cupcakes.imageset/Cupcake-icon.png differ diff --git a/Time/Time/Images.xcassets/Birthday Cake.imageset/Cake-icon.png b/Time/Time/Images.xcassets/Birthday Cake.imageset/Cake-icon.png new file mode 100644 index 0000000..e08c21e Binary files /dev/null and b/Time/Time/Images.xcassets/Birthday Cake.imageset/Cake-icon.png differ diff --git a/Time/Time/Images.xcassets/Birthday Cake.imageset/Contents.json b/Time/Time/Images.xcassets/Birthday Cake.imageset/Contents.json new file mode 100644 index 0000000..94ccc74 --- /dev/null +++ b/Time/Time/Images.xcassets/Birthday Cake.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Cake-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Contents.json b/Time/Time/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Time/Time/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Cow.imageset/Contents.json b/Time/Time/Images.xcassets/Cow.imageset/Contents.json new file mode 100644 index 0000000..4f50123 --- /dev/null +++ b/Time/Time/Images.xcassets/Cow.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Cow-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Cow.imageset/Cow-icon.png b/Time/Time/Images.xcassets/Cow.imageset/Cow-icon.png new file mode 100644 index 0000000..df28a13 Binary files /dev/null and b/Time/Time/Images.xcassets/Cow.imageset/Cow-icon.png differ diff --git a/Time/Time/Images.xcassets/Delicious Cookies.imageset/Contents.json b/Time/Time/Images.xcassets/Delicious Cookies.imageset/Contents.json new file mode 100644 index 0000000..ef883b6 --- /dev/null +++ b/Time/Time/Images.xcassets/Delicious Cookies.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Cookie-Man-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Delicious Cookies.imageset/Cookie-Man-icon.png b/Time/Time/Images.xcassets/Delicious Cookies.imageset/Cookie-Man-icon.png new file mode 100644 index 0000000..9f1e933 Binary files /dev/null and b/Time/Time/Images.xcassets/Delicious Cookies.imageset/Cookie-Man-icon.png differ diff --git a/Time/Time/Images.xcassets/Frozen Pizza.imageset/Contents.json b/Time/Time/Images.xcassets/Frozen Pizza.imageset/Contents.json new file mode 100644 index 0000000..32ab039 --- /dev/null +++ b/Time/Time/Images.xcassets/Frozen Pizza.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Pizza-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Frozen Pizza.imageset/Pizza-icon.png b/Time/Time/Images.xcassets/Frozen Pizza.imageset/Pizza-icon.png new file mode 100644 index 0000000..843816e Binary files /dev/null and b/Time/Time/Images.xcassets/Frozen Pizza.imageset/Pizza-icon.png differ diff --git a/Time/Time/Images.xcassets/Fruits.imageset/Contents.json b/Time/Time/Images.xcassets/Fruits.imageset/Contents.json new file mode 100644 index 0000000..60d3588 --- /dev/null +++ b/Time/Time/Images.xcassets/Fruits.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Fruits-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Fruits.imageset/Fruits-icon.png b/Time/Time/Images.xcassets/Fruits.imageset/Fruits-icon.png new file mode 100644 index 0000000..fa68684 Binary files /dev/null and b/Time/Time/Images.xcassets/Fruits.imageset/Fruits-icon.png differ diff --git a/Time/Time/Images.xcassets/Poached Eggs.imageset/Contents.json b/Time/Time/Images.xcassets/Poached Eggs.imageset/Contents.json new file mode 100644 index 0000000..dcbe2dc --- /dev/null +++ b/Time/Time/Images.xcassets/Poached Eggs.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Eggs-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Poached Eggs.imageset/Eggs-icon.png b/Time/Time/Images.xcassets/Poached Eggs.imageset/Eggs-icon.png new file mode 100644 index 0000000..139380e Binary files /dev/null and b/Time/Time/Images.xcassets/Poached Eggs.imageset/Eggs-icon.png differ diff --git a/Time/Time/Images.xcassets/Roast Turkey.imageset/Contents.json b/Time/Time/Images.xcassets/Roast Turkey.imageset/Contents.json new file mode 100644 index 0000000..4d4662b --- /dev/null +++ b/Time/Time/Images.xcassets/Roast Turkey.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Duck-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Roast Turkey.imageset/Duck-icon.png b/Time/Time/Images.xcassets/Roast Turkey.imageset/Duck-icon.png new file mode 100644 index 0000000..aa94375 Binary files /dev/null and b/Time/Time/Images.xcassets/Roast Turkey.imageset/Duck-icon.png differ diff --git a/Time/Time/Images.xcassets/Stir Fry Vegetables.imageset/Contents.json b/Time/Time/Images.xcassets/Stir Fry Vegetables.imageset/Contents.json new file mode 100644 index 0000000..a2c9671 --- /dev/null +++ b/Time/Time/Images.xcassets/Stir Fry Vegetables.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Leafs-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Stir Fry Vegetables.imageset/Leafs-icon.png b/Time/Time/Images.xcassets/Stir Fry Vegetables.imageset/Leafs-icon.png new file mode 100644 index 0000000..3019c9d Binary files /dev/null and b/Time/Time/Images.xcassets/Stir Fry Vegetables.imageset/Leafs-icon.png differ diff --git a/Time/Time/Images.xcassets/Stopwatch-icon.imageset/Contents.json b/Time/Time/Images.xcassets/Stopwatch-icon.imageset/Contents.json new file mode 100644 index 0000000..abc2058 --- /dev/null +++ b/Time/Time/Images.xcassets/Stopwatch-icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Stopwatch-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Stopwatch-icon.imageset/Stopwatch-icon.png b/Time/Time/Images.xcassets/Stopwatch-icon.imageset/Stopwatch-icon.png new file mode 100644 index 0000000..8bf8ad4 Binary files /dev/null and b/Time/Time/Images.xcassets/Stopwatch-icon.imageset/Stopwatch-icon.png differ diff --git a/Time/Time/Images.xcassets/Teriyaki Salmon.imageset/Contents.json b/Time/Time/Images.xcassets/Teriyaki Salmon.imageset/Contents.json new file mode 100644 index 0000000..259b767 --- /dev/null +++ b/Time/Time/Images.xcassets/Teriyaki Salmon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Fish-2-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Teriyaki Salmon.imageset/Fish-2-icon.png b/Time/Time/Images.xcassets/Teriyaki Salmon.imageset/Fish-2-icon.png new file mode 100644 index 0000000..38f471f Binary files /dev/null and b/Time/Time/Images.xcassets/Teriyaki Salmon.imageset/Fish-2-icon.png differ diff --git a/Time/Time/Images.xcassets/Timer-2-icon.imageset/Contents.json b/Time/Time/Images.xcassets/Timer-2-icon.imageset/Contents.json new file mode 100644 index 0000000..79bc358 --- /dev/null +++ b/Time/Time/Images.xcassets/Timer-2-icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Timer-2-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/Timer-2-icon.imageset/Timer-2-icon.png b/Time/Time/Images.xcassets/Timer-2-icon.imageset/Timer-2-icon.png new file mode 100644 index 0000000..4562f69 Binary files /dev/null and b/Time/Time/Images.xcassets/Timer-2-icon.imageset/Timer-2-icon.png differ diff --git a/Time/Time/Images.xcassets/default.imageset/Cardiovascular-icon.png b/Time/Time/Images.xcassets/default.imageset/Cardiovascular-icon.png new file mode 100644 index 0000000..14d00ed Binary files /dev/null and b/Time/Time/Images.xcassets/default.imageset/Cardiovascular-icon.png differ diff --git a/Time/Time/Images.xcassets/default.imageset/Contents.json b/Time/Time/Images.xcassets/default.imageset/Contents.json new file mode 100644 index 0000000..f42b91a --- /dev/null +++ b/Time/Time/Images.xcassets/default.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Cardiovascular-icon.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/grey-circle-smaller.imageset/Contents.json b/Time/Time/Images.xcassets/grey-circle-smaller.imageset/Contents.json new file mode 100644 index 0000000..4be118d --- /dev/null +++ b/Time/Time/Images.xcassets/grey-circle-smaller.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "grey-circle-smaller.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/grey-circle-smaller.imageset/grey-circle-smaller.png b/Time/Time/Images.xcassets/grey-circle-smaller.imageset/grey-circle-smaller.png new file mode 100644 index 0000000..38f3ca5 Binary files /dev/null and b/Time/Time/Images.xcassets/grey-circle-smaller.imageset/grey-circle-smaller.png differ diff --git a/Time/Time/Images.xcassets/grey-circle-smallest.imageset/Contents.json b/Time/Time/Images.xcassets/grey-circle-smallest.imageset/Contents.json new file mode 100644 index 0000000..db9da1d --- /dev/null +++ b/Time/Time/Images.xcassets/grey-circle-smallest.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "grey-circle-smallest.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/grey-circle-smallest.imageset/grey-circle-smallest.png b/Time/Time/Images.xcassets/grey-circle-smallest.imageset/grey-circle-smallest.png new file mode 100644 index 0000000..94998ad Binary files /dev/null and b/Time/Time/Images.xcassets/grey-circle-smallest.imageset/grey-circle-smallest.png differ diff --git a/Time/Time/Images.xcassets/grey-circle.imageset/Contents.json b/Time/Time/Images.xcassets/grey-circle.imageset/Contents.json new file mode 100644 index 0000000..6ef51db --- /dev/null +++ b/Time/Time/Images.xcassets/grey-circle.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "grey-circle.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/grey-circle.imageset/grey-circle.png b/Time/Time/Images.xcassets/grey-circle.imageset/grey-circle.png new file mode 100644 index 0000000..91f0aa4 Binary files /dev/null and b/Time/Time/Images.xcassets/grey-circle.imageset/grey-circle.png differ diff --git a/Time/Time/Images.xcassets/new-button.imageset/Contents.json b/Time/Time/Images.xcassets/new-button.imageset/Contents.json new file mode 100644 index 0000000..e64758d --- /dev/null +++ b/Time/Time/Images.xcassets/new-button.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "new-button.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/new-button.imageset/new-button.png b/Time/Time/Images.xcassets/new-button.imageset/new-button.png new file mode 100644 index 0000000..b4f388c Binary files /dev/null and b/Time/Time/Images.xcassets/new-button.imageset/new-button.png differ diff --git a/Time/Time/Images.xcassets/nutella-day.imageset/Contents.json b/Time/Time/Images.xcassets/nutella-day.imageset/Contents.json new file mode 100644 index 0000000..aa65877 --- /dev/null +++ b/Time/Time/Images.xcassets/nutella-day.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "nutella-day.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/nutella-day.imageset/nutella-day.png b/Time/Time/Images.xcassets/nutella-day.imageset/nutella-day.png new file mode 100644 index 0000000..db7eb29 Binary files /dev/null and b/Time/Time/Images.xcassets/nutella-day.imageset/nutella-day.png differ diff --git a/Time/Time/Images.xcassets/pizza-day.imageset/Contents.json b/Time/Time/Images.xcassets/pizza-day.imageset/Contents.json new file mode 100644 index 0000000..2572fd7 --- /dev/null +++ b/Time/Time/Images.xcassets/pizza-day.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "pizza-day.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/pizza-day.imageset/pizza-day.png b/Time/Time/Images.xcassets/pizza-day.imageset/pizza-day.png new file mode 100644 index 0000000..0edce07 Binary files /dev/null and b/Time/Time/Images.xcassets/pizza-day.imageset/pizza-day.png differ diff --git a/Time/Time/Images.xcassets/roastChicken.imageset/Contents.json b/Time/Time/Images.xcassets/roastChicken.imageset/Contents.json new file mode 100644 index 0000000..fe38059 --- /dev/null +++ b/Time/Time/Images.xcassets/roastChicken.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "roastChicken.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/roastChicken.imageset/roastChicken.png b/Time/Time/Images.xcassets/roastChicken.imageset/roastChicken.png new file mode 100644 index 0000000..1655c8a Binary files /dev/null and b/Time/Time/Images.xcassets/roastChicken.imageset/roastChicken.png differ diff --git a/Time/Time/Images.xcassets/sandwich-day.imageset/Contents.json b/Time/Time/Images.xcassets/sandwich-day.imageset/Contents.json new file mode 100644 index 0000000..4e4bcf8 --- /dev/null +++ b/Time/Time/Images.xcassets/sandwich-day.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "sandwich-day.png" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Time/Time/Images.xcassets/sandwich-day.imageset/sandwich-day.png b/Time/Time/Images.xcassets/sandwich-day.imageset/sandwich-day.png new file mode 100644 index 0000000..20ced5d Binary files /dev/null and b/Time/Time/Images.xcassets/sandwich-day.imageset/sandwich-day.png differ diff --git a/Time/Time/Info.plist b/Time/Time/Info.plist index 62e151f..2066bc6 100644 --- a/Time/Time/Info.plist +++ b/Time/Time/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.mikekavouras.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,11 @@ 1 LSRequiresIPhoneOS + UIAppFonts + + Akkurat Regular.otf + Akkurat Bold.otf + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -33,8 +38,6 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad diff --git a/Time/Time/PresetEventCountdownViewController.h b/Time/Time/PresetEventCountdownViewController.h new file mode 100644 index 0000000..e82678c --- /dev/null +++ b/Time/Time/PresetEventCountdownViewController.h @@ -0,0 +1,14 @@ +// +// PresetEventCountdownViewController.h +// Time +// +// Created by Shena Yoshida on 8/23/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import +@import SpriteKit; + +@interface PresetEventCountdownViewController : UIViewController + +@end diff --git a/Time/Time/PresetEventCountdownViewController.m b/Time/Time/PresetEventCountdownViewController.m new file mode 100644 index 0000000..548eccf --- /dev/null +++ b/Time/Time/PresetEventCountdownViewController.m @@ -0,0 +1,112 @@ +// +// PresetEventCountdownViewController.m +// Time +// +// Created by Shena Yoshida on 8/23/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "PresetEventCountdownViewController.h" +#import "BokehScene.h" + +@interface PresetEventCountdownViewController () + +@property (nonatomic) SKView *particleBackground; + +@property (weak, nonatomic) IBOutlet UILabel *countdownLabel1; +@property (weak, nonatomic) IBOutlet UILabel *countdownLabel2; +@property (weak, nonatomic) IBOutlet UILabel *countdownLabel3; + +@property (strong, nonatomic) NSDate *destinationDate1; +@property (strong, nonatomic) NSDate *destinationDate2; +@property (strong, nonatomic) NSDate *destinationDate3; +@property (strong, nonatomic) NSTimer *timer; + +@property (weak, nonatomic) IBOutlet UIView *contentView; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentViewWidthConstraint; + +// continue adding preset dates to scroll view +// ideas: national cheese pizza day (sept 5), world nutella day (feb 5) + +@end + +@implementation PresetEventCountdownViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + + self.particleBackground = [[SKView alloc] init]; + BokehScene * scene = [BokehScene sceneWithSize:self.view.bounds.size]; // add spritekit animated images to background! + scene.scaleMode = SKSceneScaleModeAspectFill; + [self.particleBackground presentScene:scene]; + + [self.contentView insertSubview:self.particleBackground atIndex:0]; + + + self.destinationDate1 = [NSDate dateWithTimeIntervalSince1970:1478131200]; // epoch time conversion for Nov 3, National Sandwich Day + self.destinationDate2 = [NSDate dateWithTimeIntervalSince1970:1486252800]; // nutella day, feb 5 + self.destinationDate3 = [NSDate dateWithTimeIntervalSince1970:1486598400]; // international pizza with everything (except anchovies) day, feb 9 + + self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateLabel) userInfo:nil repeats:YES]; + + +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:YES]; // hide navigation bar that pops up automatically w swipe recognizer + +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + [self.navigationController setNavigationBarHidden:NO]; + +} + +- (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; + + self.particleBackground = nil; + // self.particleBack + [self.particleBackground presentScene:nil]; + +} + +- (void)viewWillLayoutSubviews { + [super viewWillLayoutSubviews]; + + self.particleBackground.frame = self.contentView.bounds; + self.contentViewWidthConstraint.constant = self.view.frame.size.width; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)updateLabel { + + NSCalendar *calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + int units = NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; + + NSDateComponents *components = [calendar components:units fromDate:[NSDate date] toDate: self.destinationDate1 options:0]; // timer 1 + NSDateComponents *components2 = [calendar components:units fromDate:[NSDate date] toDate: self.destinationDate2 options:0]; // timer 2 + NSDateComponents *components3 = [calendar components:units fromDate:[NSDate date] toDate: self.destinationDate3 options:0]; // timer 3 + + // set text labels + self.countdownLabel1.text = [NSString stringWithFormat:@"%ld%c:%ld%c:%ld%c:%ld%c", (long)[components day], 'd', (long)[components hour]+4, 'h', (long)[components minute], 'm', (long)[components second], 's']; + + self.countdownLabel2.text = [NSString stringWithFormat:@"%ld%c:%ld%c:%ld%c:%ld%c", (long)[components2 day], 'd', (long)[components2 hour]+4, 'h', (long)[components2 minute], 'm', (long)[components2 second], 's']; + + self.countdownLabel3.text = [NSString stringWithFormat:@"%ld%c:%ld%c:%ld%c:%ld%c", (long)[components3 day], 'd', (long)[components3 hour]+4, 'h', (long)[components3 minute], 'm', (long)[components3 second], 's']; +} + +- (IBAction)swipeBack:(UISwipeGestureRecognizer *)sender { + [self.navigationController popViewControllerAnimated:YES]; + + // [self.particleBackground presentScene:nil]; // end spritekit when moving back +} + +@end diff --git a/Time/Time/PresetTimerAddViewController.h b/Time/Time/PresetTimerAddViewController.h new file mode 100644 index 0000000..b1c9bf3 --- /dev/null +++ b/Time/Time/PresetTimerAddViewController.h @@ -0,0 +1,17 @@ +// +// PresetTimerAddViewController.h +// Time +// +// Created by Xiulan Shi on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import +#import "Timer.h" +#import "PresetTimerViewController.h" + +@interface PresetTimerAddViewController : UIViewController + +@property (nonatomic, weak) PresetTimerViewController *timerViewController; + +@end diff --git a/Time/Time/PresetTimerAddViewController.m b/Time/Time/PresetTimerAddViewController.m new file mode 100644 index 0000000..554b194 --- /dev/null +++ b/Time/Time/PresetTimerAddViewController.m @@ -0,0 +1,87 @@ +// +// PresetTimerAddViewController.m +// Time +// +// Created by Xiulan Shi on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "PresetTimerAddViewController.h" +#import "TimerModel.h" + +@interface PresetTimerAddViewController () + +@property (nonatomic) TimerModel *model; +@property (weak, nonatomic) IBOutlet UIDatePicker *selectTime; +@property (weak, nonatomic) IBOutlet UILabel *time; +@property (weak, nonatomic) IBOutlet UITextField *timerName; + + + +@end + +@implementation PresetTimerAddViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.model = [[TimerModel alloc] init]; + [self.model initializeModel]; + + self.timerName.delegate = self; + +} + + +- (void)saveNewTimer{ + + Timer *newTimer = [[Timer alloc] init]; + + newTimer.timerName = self.timerName.text; + + newTimer.imageName = @"default"; + + newTimer.countDownDuration = self.selectTime.countDownDuration; + + [self.timerViewController.model.timers insertObject:newTimer atIndex:0]; + + +} + + +- (IBAction)saveButtonTapped:(id)sender { + + [self saveNewTimer]; + [self dismissViewControllerAnimated:YES completion:nil]; + +} + +- (IBAction)cancelButtonTapped:(id)sender { + + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + [textField resignFirstResponder]; + + // NSLog(@"Current text: %@", textField.text); + + return YES; +} + +/* + #pragma mark - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. + } + */ + +@end diff --git a/Time/Time/PresetTimerDetailViewController.h b/Time/Time/PresetTimerDetailViewController.h new file mode 100644 index 0000000..5e89747 --- /dev/null +++ b/Time/Time/PresetTimerDetailViewController.h @@ -0,0 +1,17 @@ +// +// PresetTimerDetailViewController.h +// Time +// +// Created by Xiulan Shi on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import +#import +#import "Timer.h" + +@interface PresetTimerDetailViewController : UIViewController + +@property (nonatomic) Timer *currentTimer; + +@end diff --git a/Time/Time/PresetTimerDetailViewController.m b/Time/Time/PresetTimerDetailViewController.m new file mode 100644 index 0000000..ef81a53 --- /dev/null +++ b/Time/Time/PresetTimerDetailViewController.m @@ -0,0 +1,228 @@ +// +// PresetTimerDetailViewController.m +// Time +// +// Created by Xiulan Shi on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// +#import "PresetTimerDetailViewController.h" + +@interface PresetTimerDetailViewController () +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; + +@property (weak, nonatomic) IBOutlet UILabel *weightLabel; +@property (weak, nonatomic) IBOutlet UIButton *add; +@property (weak, nonatomic) IBOutlet UIButton *subtract; + +@property (weak, nonatomic) IBOutlet UILabel *weightText; + +//@property (weak, nonatomic) IBOutlet UIDatePicker *datePicker; + +@property (weak, nonatomic) IBOutlet UIButton *startCancelButton; + +@property (weak, nonatomic) IBOutlet UIButton *pauseResumeButton; + + +@property (weak, nonatomic) IBOutlet UILabel *timeLabel; + +@property (weak, nonatomic) IBOutlet UIImageView *imageView; + +@property (nonatomic) BOOL isTimerRunning; +@property (nonatomic) BOOL isPaused; + +@property (nonatomic) int hours; +@property (nonatomic) int minutes; +@property (nonatomic) int seconds; + +@property (nonatomic) int secondsCount; + +@property (nonatomic) int weight; +@property (nonatomic) int newTime; + +@property (nonatomic) NSTimer *timer; + +@property AVAudioPlayer *timeEnds; + +@end + +@implementation PresetTimerDetailViewController + + +- (AVAudioPlayer *)setupAudioPlayerWithFile:(NSString *)file type:(NSString *)type { + NSString *path = [[NSBundle mainBundle] pathForResource:file ofType:type]; + NSURL *url = [NSURL fileURLWithPath:path]; + NSError *error; + AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error]; + if (!audioPlayer) { + NSLog(@"%@", [error description]); + } + return audioPlayer; +} + + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + + self.nameLabel.text = self.currentTimer.timerName; + self.imageView.image = [UIImage imageNamed:self.currentTimer.imageName]; + + if ([self.nameLabel.text isEqualToString:@"Roast Turkey"]) { + self.weightLabel.hidden = NO; + self.add.hidden = NO; + self.subtract.hidden = NO; + self.weightText.hidden = NO; + self.weight = self.currentTimer.countDownDuration/60/13; + self.newTime = self.currentTimer.countDownDuration; + } + else { + self.weightLabel.hidden = YES; + self.add.hidden = YES; + self.subtract.hidden = YES; + self.weightText.hidden = YES; + } + + self.hours = self.currentTimer.countDownDuration/3600; + self.minutes = (self.currentTimer.countDownDuration % 3600)/60; + self.seconds = self.currentTimer.countDownDuration - (self.hours * 3600) - (self.minutes * 60); + + self.timeLabel.text = [NSString stringWithFormat:@"%02i:%02i:%02i", self.hours, self.minutes, self.seconds]; + + self.isTimerRunning = NO; + self.isPaused = NO; + self.pauseResumeButton.enabled = NO; + self.timeEnds = [self setupAudioPlayerWithFile:@"ping-sound" type:@"mp3"]; + + +} + +- (IBAction)addButtonTapped:(id)sender { + self.weight ++; + self.weightLabel.text = [NSString stringWithFormat:@"%i", self.weight]; + self.newTime = self.weight * 13 * 60; + + self.hours = self.newTime/3600; + self.minutes = (self.newTime % 3600)/60; + self.seconds = self.newTime - (self.hours * 3600) - (self.minutes * 60); + + self.timeLabel.text = [NSString stringWithFormat:@"%02i:%02i:%02i", self.hours, self.minutes, self.seconds]; + +} +- (IBAction)subtractButtonTapped:(id)sender { + if (self.weight < 1) { + return; + } + self.weight --; + self.weightLabel.text = [NSString stringWithFormat:@"%i", self.weight]; + self.newTime = self.weight * 13 * 60; + + self.hours = self.newTime/3600; + self.minutes = (self.newTime % 3600)/60; + self.seconds = self.newTime - (self.hours * 3600) - (self.minutes * 60); + + self.timeLabel.text = [NSString stringWithFormat:@"%02i:%02i:%02i", self.hours, self.minutes, self.seconds];} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)startCancelButton:(id)sender { + + if ([self.nameLabel.text isEqualToString:@"Roast Turkey"]) { + self.secondsCount = self.newTime; + } + else + { + self.secondsCount = self.currentTimer.countDownDuration; + } + + self.timeLabel.text = [NSString stringWithFormat:@"%02i:%02i:%02i", self.hours, self.minutes, self.seconds]; + + if (self.isTimerRunning == YES) { + + self.timeLabel.alpha = 0; + [self.startCancelButton setTitle:@"START" forState:UIControlStateNormal]; + [self.pauseResumeButton setTitle:@"PAUSE" forState:UIControlStateNormal]; + self.pauseResumeButton.enabled = NO; + + [self.timer invalidate]; + self.timer = nil; + + } else { + + self.timeLabel.alpha = 1; + + [self.startCancelButton setTitle:@"CANCEL" forState:UIControlStateNormal]; + self.pauseResumeButton.enabled = YES; + + if (self.timer == nil) { + self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 + target:self + selector:@selector(updateTimer) + userInfo:nil + repeats:YES]; + } + + } + + self.isTimerRunning = !self.isTimerRunning; + +} + +- (void) updateTimer { + + self.secondsCount--; + + self.hours = self.secondsCount/3600; + self.minutes = (self.secondsCount % 3600)/60; + self.seconds = self.secondsCount - (self.hours * 3600) - (self.minutes * 60); + + self.timeLabel.text = [NSString stringWithFormat:@"%02i:%02i:%02i", self.hours, self.minutes, self.seconds]; + + + if (self.secondsCount <= 0) { + + [self.timer invalidate]; + self.timer = nil; + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Time Done" message:[NSString stringWithFormat:@"Your %@ Are Ready",self.currentTimer.timerName] delegate:self cancelButtonTitle:@"OK"otherButtonTitles:nil]; + + [alert show]; + [self.timeEnds play]; + + self.timeLabel.alpha = 0; + [self.startCancelButton setTitle:@"START" forState:UIControlStateNormal]; + self.pauseResumeButton.enabled = NO; + + } + +} + +- (IBAction)pauseResumeButton:(id)sender { + if (self.isPaused == NO) { + [self.timer invalidate]; + self.timer = nil; + + [self.pauseResumeButton setTitle:@"RESUME" forState:UIControlStateNormal]; + + } else { + if (self.timer) { + [self.timer invalidate]; + self.timer = nil; + } + self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 + target:self + selector:@selector(updateTimer) + userInfo:nil + repeats:YES]; + + [self.pauseResumeButton setTitle:@"PAUSE" forState:UIControlStateNormal]; + } + + self.isPaused = !self.isPaused; + +} + + +@end diff --git a/Time/Time/PresetTimerViewController.h b/Time/Time/PresetTimerViewController.h new file mode 100644 index 0000000..95e8fad --- /dev/null +++ b/Time/Time/PresetTimerViewController.h @@ -0,0 +1,17 @@ +// +// PresetTimerViewController.h +// Time +// +// Created by Shena Yoshida on 8/23/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import +#import "Timer.h" +#import "TimerModel.h" + +@interface PresetTimerViewController : UIViewController + +@property (nonatomic)TimerModel *model; + +@end diff --git a/Time/Time/PresetTimerViewController.m b/Time/Time/PresetTimerViewController.m new file mode 100644 index 0000000..fff1f43 --- /dev/null +++ b/Time/Time/PresetTimerViewController.m @@ -0,0 +1,145 @@ +// +// PresetTimerViewController.m +// Time +// +// Created by Shena Yoshida on 8/23/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "PresetTimerViewController.h" +#import "PresetTimerAddViewController.h" +#import "PresetTimerDetailViewController.h" + +@interface PresetTimerViewController () +@property (weak, nonatomic) IBOutlet UITableView *tableView; + +@end + +@implementation PresetTimerViewController + + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.model = [TimerModel sharedInstance]; + [self.model initializeModel]; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(editButtonTapped:)]; + self.tableView.dataSource = self; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonTapped)]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self.tableView reloadData]; +} + +- (void)editButtonTapped:(UIBarButtonItem *)button { + [self.tableView setEditing:YES animated:YES]; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(stopEditingButtonTapped:)]; +} + +- (void)stopEditingButtonTapped:(UIBarButtonItem *)button { + [self.tableView setEditing:NO animated:YES]; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(editButtonTapped:)]; + +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + + [self.model.timers removeObjectAtIndex:indexPath.row]; + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } + else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } +} + + + +- (void)addButtonTapped { + + PresetTimerAddViewController *myNewVC = [self.storyboard instantiateViewControllerWithIdentifier:@"showAdd"]; + myNewVC.timerViewController = self; + [self presentViewController:myNewVC animated:YES completion:nil]; + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (IBAction)swipeBack:(UISwipeGestureRecognizer *)sender { + [self.navigationController popViewControllerAnimated:YES]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [self.model.timers count]; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"presetTimerIdentifier" forIndexPath:indexPath]; + + + Timer *timer = [self.model.timers objectAtIndex:indexPath.row]; + + cell.textLabel.text = timer.timerName; + + int minutes = timer.countDownDuration/60; + + cell.detailTextLabel.text = [NSString stringWithFormat:@"%i Mins", minutes]; + cell.imageView.image = [UIImage imageNamed:timer.imageName]; + [cell layoutIfNeeded]; + return cell; + +} + + + +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. + + if ([segue.identifier isEqual:@"showAdd"]) { + + PresetTimerAddViewController *addVC = segue.destinationViewController; + + addVC.timerViewController = self; + + } + else + { + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + Timer *currentTimer = [self.model.timers objectAtIndex:indexPath.row]; + PresetTimerDetailViewController *detailVC = segue.destinationViewController; + + detailVC.currentTimer = currentTimer; + + } + +} + + +@end + + + + + + + diff --git a/Time/Time/StopTimer.h b/Time/Time/StopTimer.h new file mode 100644 index 0000000..70b7a6f --- /dev/null +++ b/Time/Time/StopTimer.h @@ -0,0 +1,15 @@ +// +// StopTimer.h +// Time +// +// Created by Shena Yoshida on 8/22/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface StopTimer : NSTimer + +@property (nonatomic) NSString *timerData; + +@end diff --git a/Time/Time/StopTimer.m b/Time/Time/StopTimer.m new file mode 100644 index 0000000..6bb063c --- /dev/null +++ b/Time/Time/StopTimer.m @@ -0,0 +1,13 @@ +// +// StopTimer.m +// Time +// +// Created by Shena Yoshida on 8/22/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "StopTimer.h" + +@implementation StopTimer + +@end diff --git a/Time/Time/StopWatchTabBarController.h b/Time/Time/StopWatchTabBarController.h new file mode 100644 index 0000000..8e015c9 --- /dev/null +++ b/Time/Time/StopWatchTabBarController.h @@ -0,0 +1,14 @@ +// +// StopWatchTabBarController.h +// Time +// +// Created by Xiulan Shi on 8/22/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface StopWatchTabBarController : UIViewController + + +@end diff --git a/Time/Time/StopWatchTabBarController.m b/Time/Time/StopWatchTabBarController.m new file mode 100644 index 0000000..cb41bff --- /dev/null +++ b/Time/Time/StopWatchTabBarController.m @@ -0,0 +1,132 @@ +// +// StopWatchTabBarController.m +// Time +// +// Created by Xiulan Shi on 8/22/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "StopWatchTabBarController.h" + +//@interface StopWatchTabBarController () +@interface StopWatchTabBarController () + +@property (strong, nonatomic) IBOutlet UILabel *timerDisplay; +@property (strong, nonatomic) IBOutlet UILabel *lapTimerLabel; +@property (strong, nonatomic) IBOutlet UIButton *startButton; +@property (strong, nonatomic) IBOutlet UIButton *lapButton; +@property (weak, nonatomic) IBOutlet UITableView *lapsTableView; +@property (nonatomic) BOOL timerIsRunning; +@property (nonatomic) NSMutableArray *savedLapTimes; + +@end + +@implementation StopWatchTabBarController + +float timeTick = 0.00; // the timer always begins at this number! +NSTimer *timer; + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.timerIsRunning = NO; + self.timerDisplay.text = [[NSString alloc] initWithFormat:@"%.2f",timeTick]; + self.lapTimerLabel.text = [[NSString alloc] initWithFormat:@"%.2f", timeTick]; + + [self.startButton setTitle:@"START" forState:UIControlStateNormal]; // set default text + [self.lapButton setTitle:@"LAP" forState:UIControlStateNormal]; + + // self.savedLapTimes = [NSMutableArray arrayWithObjects:@"", nil]; // store lap times + self.savedLapTimes = [NSMutableArray new]; + + [self.tabBarController.tabBar setTintColor:[UIColor blackColor]]; // change selected button color to white + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +- (void)tick { + + float currentNumber = [self.timerDisplay.text floatValue]; // get float value of string each time timer is fired + float currentLap = [self.lapTimerLabel.text floatValue]; + + float nextNumber = currentNumber +.01; // add 0.01 to present time + float nextLap = currentLap +.01; + + self.timerDisplay.text = [NSString stringWithFormat:@"%.2f", nextNumber]; // set time to label text + self.lapTimerLabel.text = [NSString stringWithFormat:@"%.2f", nextLap]; + } + +- (IBAction)startPauseButton:(id)sender { // start button tapped + + [timer invalidate]; + timer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(tick) userInfo:nil repeats:YES]; + + if (self.timerIsRunning) { + + self.timerIsRunning = NO; // timer state: stopped + [timer invalidate]; + [self.startButton setTitle:@"START" forState:UIControlStateNormal]; + [self.lapButton setTitle:@"RESET" forState:UIControlStateNormal]; + + } else { + + self.timerIsRunning = YES; // timer state: running + [self.startButton setTitle:@"PAUSE" forState:UIControlStateNormal]; + [self.lapButton setTitle:@"LAP" forState:UIControlStateNormal]; + } +} + +- (IBAction)lapButton:(id)sender { // lap button tapped + + if (self.timerIsRunning) { // timer state: running + + [self.savedLapTimes insertObject:self.lapTimerLabel.text atIndex:0]; // add new item to the top of the list + + +// NSLog(@"savedLapTimes = %@", self.lapTimerLabel.text); // log text to test +// NSLog(@"%@", self.savedLapTimes); + + [self.lapsTableView reloadData]; // reload view with new values added + + self.lapTimerLabel.text = @"0.00"; + + } else { + + self.timerDisplay.text = @"0.00"; // main label keep going + self.lapTimerLabel.text = @"0.00"; // lap label set to 0 (should also record time!!) + + [self.savedLapTimes removeAllObjects]; // reset lap array + [self.lapsTableView reloadData]; // reload table view + + } +} + + +// Set up tableView here: +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.savedLapTimes.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"savedLapTimeIdentifier" forIndexPath:indexPath]; + +// cell.textLabel.text = self.savedLapTimes[indexPath.row]; + + //this should add lap numbers to code... + NSInteger index = self.savedLapTimes.count - indexPath.row; + NSString *cellText = [NSString stringWithFormat: @"Lap %ld \t \t", (long)index]; + cell.textLabel.text = cellText; + cell.detailTextLabel.text = self.savedLapTimes[indexPath.row]; // set detail text label to time + + return cell; + +} + +@end diff --git a/Time/Time/Timer.h b/Time/Time/Timer.h new file mode 100644 index 0000000..3ab8759 --- /dev/null +++ b/Time/Time/Timer.h @@ -0,0 +1,17 @@ +// +// Timer.h +// Time +// +// Created by Xiulan Shi on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface Timer : NSObject + +@property (nonatomic) NSString *timerName; +@property (nonatomic) NSString *imageName; + +@property (nonatomic) int countDownDuration; +@end diff --git a/Time/Time/Timer.m b/Time/Time/Timer.m new file mode 100644 index 0000000..995874b --- /dev/null +++ b/Time/Time/Timer.m @@ -0,0 +1,13 @@ +// +// Timer.m +// Time +// +// Created by Xiulan Shi on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "Timer.h" + +@implementation Timer + +@end diff --git a/Time/Time/TimerModel.h b/Time/Time/TimerModel.h new file mode 100644 index 0000000..77bbe6b --- /dev/null +++ b/Time/Time/TimerModel.h @@ -0,0 +1,20 @@ +// +// TimerModel.h +// Time +// +// Created by Xiulan Shi on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface TimerModel : NSObject + +@property (nonatomic) NSMutableArray *timers; + ++ (instancetype)sharedInstance; + +- (void)initializeModel; + + +@end diff --git a/Time/Time/TimerModel.m b/Time/Time/TimerModel.m new file mode 100644 index 0000000..c303f15 --- /dev/null +++ b/Time/Time/TimerModel.m @@ -0,0 +1,65 @@ +// +// TimerModel.m +// Time +// +// Created by Xiulan Shi on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "TimerModel.h" +#import "Timer.h" + +@implementation TimerModel + ++ (instancetype)sharedInstance { + + static TimerModel *sharedInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[TimerModel alloc] init]; + }); + return sharedInstance; + +} + + +- (void)initializeModel { + + self.timers = [[NSMutableArray alloc] init]; + + Timer *eggs = [[Timer alloc] init]; + eggs.timerName = @"Poached Eggs"; + eggs.countDownDuration = 180; + eggs.imageName = @"Poached Eggs"; + [self.timers addObject:eggs]; + + Timer *vegetables = [[Timer alloc] init]; + vegetables.timerName = @"Stir Fry Vegetables"; + vegetables.countDownDuration = 300; + vegetables.imageName = @"Stir Fry Vegetables"; + [self.timers addObject:vegetables]; + + Timer *fish = [[Timer alloc] init]; + fish.timerName = @"Teriyaki Salmon"; + fish.countDownDuration = 600; + fish.imageName = @"Teriyaki Salmon"; + [self.timers addObject:fish]; + + Timer *cookie = [[Timer alloc] init]; + cookie.timerName = @"Delicious Cookies"; + cookie.countDownDuration = 720; + cookie.imageName = @"Delicious Cookies"; + [self.timers addObject:cookie]; + + Timer *turkey = [[Timer alloc] init]; + turkey.timerName = @"Roast Turkey"; + turkey.countDownDuration = 3900; + turkey.imageName = @"Roast Turkey"; + [self.timers addObject:turkey]; + + +} + + + +@end diff --git a/Time/Time/TimerTabBarController.h b/Time/Time/TimerTabBarController.h new file mode 100644 index 0000000..814ab61 --- /dev/null +++ b/Time/Time/TimerTabBarController.h @@ -0,0 +1,14 @@ +// +// TimerTabBarController.h +// Time +// +// Created by Xiulan Shi on 8/22/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import +#import + +@interface TimerTabBarController : UIViewController + +@end diff --git a/Time/Time/TimerTabBarController.m b/Time/Time/TimerTabBarController.m new file mode 100644 index 0000000..bdbf5dd --- /dev/null +++ b/Time/Time/TimerTabBarController.m @@ -0,0 +1,187 @@ +// +// TimerTabBarController.m +// Time +// +// Created by Xiulan Shi on 8/22/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "TimerTabBarController.h" + +@interface TimerTabBarController () +@property (weak, nonatomic) IBOutlet UIDatePicker *datePicker; +@property (weak, nonatomic) IBOutlet UILabel *timeLabel; +@property (weak, nonatomic) IBOutlet UIButton *startCancelButton; +@property (weak, nonatomic) IBOutlet UIButton *pauseResumeButton; +@property (nonatomic) BOOL isTimerRunning; +@property (nonatomic) BOOL isPaused; +@property (weak, nonatomic) IBOutlet UIImageView *animatedPicture; // added for animation + +@property (nonatomic) int hours; +@property (nonatomic) int minutes; +@property (nonatomic) int seconds; + +@property (nonatomic) int secondsCount; + +@property (nonatomic) NSTimer *timer; + +@property AVAudioPlayer *timeEnds; + + +@end + +@implementation TimerTabBarController + +- (AVAudioPlayer *)setupAudioPlayerWithFile:(NSString *)file type:(NSString *)type { + NSString *path = [[NSBundle mainBundle] pathForResource:file ofType:type]; + NSURL *url = [NSURL fileURLWithPath:path]; + NSError *error; + AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error]; + if (!audioPlayer) { + NSLog(@"%@", [error description]); + } + return audioPlayer; +} + + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.isTimerRunning = NO; + self.isPaused = NO; + self.pauseResumeButton.enabled = NO; + self.timeEnds = [self setupAudioPlayerWithFile:@"ping-sound" type:@"mp3"]; +} + +- (void)animationSetup { // added method so you can start/stop animation anywhere in timer state + + self.animatedPicture.animationImages = [NSArray arrayWithObjects: + //[UIImage imageNamed:@"ticker1.png"], + [UIImage imageNamed:@"ticker2.png"], + [UIImage imageNamed:@"ticker3.png"], + [UIImage imageNamed:@"ticker4.png"], + // [UIImage imageNamed:@"ticker5.png"], + [UIImage imageNamed:@"ticker6.png"], + [UIImage imageNamed:@"ticker7.png"], + [UIImage imageNamed:@"ticker8.png"], nil]; + + [self.animatedPicture setAnimationRepeatCount:0]; // run animation in loop + self.animatedPicture.animationDuration = 1.0; // run speed + [self.animatedPicture startAnimating]; //start animating! +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)startCancelButton:(id)sender { + NSTimeInterval duration = self.datePicker.countDownDuration; + + self.seconds = 0; + self.hours = (int)(duration/3600.0f); + self.minutes = ((int)duration - (self.hours * 3600))/60; + + self.secondsCount = ((self.hours * 3600) + (self.minutes * 60)); + + self.timeLabel.text = [NSString stringWithFormat:@"%02i:%02i:%02i", self.hours, self.minutes, self.seconds]; + + self.datePicker.hidden = YES; // hide viewpicker when timer starts (for increased ui flexibility) + [self animationSetup]; // start animation + + if (self.isTimerRunning == YES) { + + self.timeLabel.alpha = 0; + [self.startCancelButton setTitle:@"START" forState:UIControlStateNormal]; + [self.pauseResumeButton setTitle:@"PAUSE" forState:UIControlStateNormal]; + self.pauseResumeButton.enabled = NO; + + self.datePicker.hidden = NO; // bring view picker back when timer is reset + + [self.animatedPicture stopAnimating]; // stop animation + + [self.timer invalidate]; + self.timer = nil; + + } else { + + self.timeLabel.alpha = 1; + + [self.startCancelButton setTitle:@"CANCEL" forState:UIControlStateNormal]; + self.pauseResumeButton.enabled = YES; + + if (self.timer == nil) { + self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 + target:self + selector:@selector(updateTimer) + userInfo:nil + repeats:YES]; + } + + } + + self.isTimerRunning = !self.isTimerRunning; + + +} + +- (void) updateTimer { + + self.secondsCount--; + + self.hours = self.secondsCount/3600; + self.minutes = (self.secondsCount % 3600)/60; + self.seconds = self.secondsCount - (self.hours * 3600) - (self.minutes * 60); + + self.timeLabel.text = [NSString stringWithFormat:@"%02i:%02i:%02i", self.hours, self.minutes, self.seconds]; + + if (self.secondsCount <= 0) { + + [self.timer invalidate]; + self.timer = nil; + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Time Done" message:[NSString stringWithFormat:@""] delegate:self cancelButtonTitle:@"OK"otherButtonTitles:nil]; + + [alert show]; + [self.timeEnds play]; + [self.animatedPicture stopAnimating]; + self.datePicker.hidden = NO; + + self.timeLabel.alpha = 0; + [self.startCancelButton setTitle:@"START" forState:UIControlStateNormal]; + self.pauseResumeButton.enabled = NO; + + } + +} + +- (IBAction)pauseResumeButton:(id)sender { + if (self.isPaused == NO) { + [self.timer invalidate]; + self.timer = nil; + + [self.animatedPicture stopAnimating]; // stop animation + + [self.pauseResumeButton setTitle:@"RESUME" forState:UIControlStateNormal]; + + } else { + if (self.timer) { + [self.timer invalidate]; + self.timer = nil; + + } + self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 + target:self + selector:@selector(updateTimer) + userInfo:nil + repeats:YES]; + + [self.pauseResumeButton setTitle:@"PAUSE" forState:UIControlStateNormal]; + [self.animatedPicture startAnimating]; // start animation + } + + self.isPaused = !self.isPaused; +} + + +@end diff --git a/Time/Time/ViewController.h b/Time/Time/ViewController.h deleted file mode 100644 index 9d0e38f..0000000 --- a/Time/Time/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// Time -// -// Created by Michael Kavouras on 8/20/15. -// Copyright (c) 2015 Mike Kavouras. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - diff --git a/Time/Time/ViewController.m b/Time/Time/ViewController.m deleted file mode 100644 index 194fe5f..0000000 --- a/Time/Time/ViewController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// ViewController.m -// Time -// -// Created by Michael Kavouras on 8/20/15. -// Copyright (c) 2015 Mike Kavouras. 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/Time/Time/bokeh.png b/Time/Time/bokeh.png new file mode 100644 index 0000000..c680551 Binary files /dev/null and b/Time/Time/bokeh.png differ diff --git a/Time/Time/fonts/Akkurat Bold.otf b/Time/Time/fonts/Akkurat Bold.otf new file mode 100644 index 0000000..13076b6 Binary files /dev/null and b/Time/Time/fonts/Akkurat Bold.otf differ diff --git a/Time/Time/fonts/Akkurat Italic.otf b/Time/Time/fonts/Akkurat Italic.otf new file mode 100644 index 0000000..f7148ef Binary files /dev/null and b/Time/Time/fonts/Akkurat Italic.otf differ diff --git a/Time/Time/fonts/Akkurat Light Regular.otf b/Time/Time/fonts/Akkurat Light Regular.otf new file mode 100644 index 0000000..dc9c1c9 Binary files /dev/null and b/Time/Time/fonts/Akkurat Light Regular.otf differ diff --git a/Time/Time/fonts/Akkurat Regular.otf b/Time/Time/fonts/Akkurat Regular.otf new file mode 100644 index 0000000..a967332 Binary files /dev/null and b/Time/Time/fonts/Akkurat Regular.otf differ diff --git a/Time/Time/ping-sound.mp3 b/Time/Time/ping-sound.mp3 new file mode 100644 index 0000000..4aa624b Binary files /dev/null and b/Time/Time/ping-sound.mp3 differ diff --git a/Time/Time/ticker1.png b/Time/Time/ticker1.png new file mode 100644 index 0000000..9f27303 Binary files /dev/null and b/Time/Time/ticker1.png differ diff --git a/Time/Time/ticker2.png b/Time/Time/ticker2.png new file mode 100644 index 0000000..f37f26c Binary files /dev/null and b/Time/Time/ticker2.png differ diff --git a/Time/Time/ticker3.png b/Time/Time/ticker3.png new file mode 100644 index 0000000..acdf771 Binary files /dev/null and b/Time/Time/ticker3.png differ diff --git a/Time/Time/ticker4.png b/Time/Time/ticker4.png new file mode 100644 index 0000000..2a5359f Binary files /dev/null and b/Time/Time/ticker4.png differ diff --git a/Time/Time/ticker5.png b/Time/Time/ticker5.png new file mode 100644 index 0000000..9f27303 Binary files /dev/null and b/Time/Time/ticker5.png differ diff --git a/Time/Time/ticker6.png b/Time/Time/ticker6.png new file mode 100644 index 0000000..2a5359f Binary files /dev/null and b/Time/Time/ticker6.png differ diff --git a/Time/Time/ticker7.png b/Time/Time/ticker7.png new file mode 100644 index 0000000..acdf771 Binary files /dev/null and b/Time/Time/ticker7.png differ diff --git a/Time/Time/ticker8.png b/Time/Time/ticker8.png new file mode 100644 index 0000000..f37f26c Binary files /dev/null and b/Time/Time/ticker8.png differ diff --git a/Time/TimeTests/Info.plist b/Time/TimeTests/Info.plist index 54624a4..ba72822 100644 --- a/Time/TimeTests/Info.plist +++ b/Time/TimeTests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.mikekavouras.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/TimerStoryboard 2.0.key b/TimerStoryboard 2.0.key new file mode 100644 index 0000000..3b5c81b Binary files /dev/null and b/TimerStoryboard 2.0.key differ diff --git a/timer presentation slides.key b/timer presentation slides.key new file mode 100644 index 0000000..184cc84 Binary files /dev/null and b/timer presentation slides.key differ