diff --git a/README.md b/README.md index 2a68a41..8ddc219 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Unit 1 Final Project - +#Shawn was here ## Feature Requirements 2 primary screens diff --git a/Time/Time.xcodeproj/project.pbxproj b/Time/Time.xcodeproj/project.pbxproj index c8743f0..b26187e 100644 --- a/Time/Time.xcodeproj/project.pbxproj +++ b/Time/Time.xcodeproj/project.pbxproj @@ -7,11 +7,24 @@ objects = { /* Begin PBXBuildFile section */ + 003B48381B88CEC8004C430A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 003B48371B88CEC8004C430A /* Main.storyboard */; }; + 003B48411B8A322E004C430A /* SpecialEventViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 003B48401B8A322E004C430A /* SpecialEventViewController.m */; }; + 003B48431B8A4DE7004C430A /* Images .xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 003B48421B8A4DE7004C430A /* Images .xcassets */; }; + 009067FD1B8FF8E200BCBF71 /* PresetTimerTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 009067FC1B8FF8E200BCBF71 /* PresetTimerTableViewController.m */; }; + 009068381B92518900BCBF71 /* TimerData.m in Sources */ = {isa = PBXBuildFile; fileRef = 009068371B92518900BCBF71 /* TimerData.m */; }; + 45855BAE1B86A2A3008B61B8 /* StopwatchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 45855BAD1B86A2A3008B61B8 /* StopwatchViewController.m */; }; + 45855BB11B86A2BB008B61B8 /* TimerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 45855BB01B86A2BB008B61B8 /* TimerViewController.m */; }; + 45855BB31B88FB48008B61B8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45855BB21B88FB48008B61B8 /* QuartzCore.framework */; }; + 45C16ECD1B92334600C81079 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C16ECC1B92334600C81079 /* MediaPlayer.framework */; }; + 45C600BD1B8A475C004C6714 /* WorldClockTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 45C600BC1B8A475C004C6714 /* WorldClockTableViewController.m */; }; + 45C9BBAE1B938D7A009001E2 /* WorldClockInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 45C9BBAD1B938D7A009001E2 /* WorldClockInfo.m */; }; + 45C9BBB11B938E28009001E2 /* NewWorldClockTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 45C9BBB01B938E28009001E2 /* NewWorldClockTableViewController.m */; }; + 45C9BBE51B95379D009001E2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C9BBE41B95379D009001E2 /* AVFoundation.framework */; }; + 45E331B41B968923005D6871 /* Wat.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 45E331B31B968923005D6871 /* Wat.mp3 */; }; + 45E331B61B969774005D6871 /* Video.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 45E331B51B969774005D6871 /* Video.mp4 */; }; + 45E331F01B96A2BF005D6871 /* Video.mp4 in Sources */ = {isa = PBXBuildFile; fileRef = 45E331B51B969774005D6871 /* Video.mp4 */; }; 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 */; }; /* End PBXBuildFile section */ @@ -27,15 +40,34 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 003B48371B88CEC8004C430A /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; + 003B483F1B8A322E004C430A /* SpecialEventViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecialEventViewController.h; sourceTree = ""; }; + 003B48401B8A322E004C430A /* SpecialEventViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpecialEventViewController.m; sourceTree = ""; }; + 003B48421B8A4DE7004C430A /* Images .xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Images .xcassets"; sourceTree = ""; }; + 009067F91B8FE7E700BCBF71 /* PresetTimerTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PresetTimerTableViewController.h; sourceTree = ""; }; + 009067FC1B8FF8E200BCBF71 /* PresetTimerTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresetTimerTableViewController.m; sourceTree = ""; }; + 009068361B9250F200BCBF71 /* TimerData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TimerData.h; sourceTree = ""; }; + 009068371B92518900BCBF71 /* TimerData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TimerData.m; sourceTree = ""; }; + 45855BAC1B86A2A3008B61B8 /* StopwatchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StopwatchViewController.h; sourceTree = ""; }; + 45855BAD1B86A2A3008B61B8 /* StopwatchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StopwatchViewController.m; sourceTree = ""; }; + 45855BAF1B86A2BB008B61B8 /* TimerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimerViewController.h; sourceTree = ""; }; + 45855BB01B86A2BB008B61B8 /* TimerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TimerViewController.m; sourceTree = ""; }; + 45855BB21B88FB48008B61B8 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 45C16ECC1B92334600C81079 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; + 45C600BB1B8A475C004C6714 /* WorldClockTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorldClockTableViewController.h; sourceTree = ""; }; + 45C600BC1B8A475C004C6714 /* WorldClockTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WorldClockTableViewController.m; sourceTree = ""; }; + 45C9BBAC1B938D7A009001E2 /* WorldClockInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorldClockInfo.h; sourceTree = ""; }; + 45C9BBAD1B938D7A009001E2 /* WorldClockInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WorldClockInfo.m; sourceTree = ""; }; + 45C9BBAF1B938E28009001E2 /* NewWorldClockTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewWorldClockTableViewController.h; sourceTree = ""; }; + 45C9BBB01B938E28009001E2 /* NewWorldClockTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewWorldClockTableViewController.m; sourceTree = ""; }; + 45C9BBE41B95379D009001E2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 45E331B31B968923005D6871 /* Wat.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = Wat.mp3; path = Time/Wat.mp3; sourceTree = ""; }; + 45E331B51B969774005D6871 /* Video.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = Video.mp4; 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 = ""; }; @@ -47,6 +79,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 45C9BBE51B95379D009001E2 /* AVFoundation.framework in Frameworks */, + 45C16ECD1B92334600C81079 /* MediaPlayer.framework in Frameworks */, + 45855BB31B88FB48008B61B8 /* QuartzCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -60,10 +95,23 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 45C9BBED1B954B6A009001E2 /* Sounds */ = { + isa = PBXGroup; + children = ( + 45E331B51B969774005D6871 /* Video.mp4 */, + 45E331B31B968923005D6871 /* Wat.mp3 */, + ); + name = Sounds; + sourceTree = ""; + }; 8D05374F1B86687B00588318 = { isa = PBXGroup; children = ( + 45C9BBE41B95379D009001E2 /* AVFoundation.framework */, + 45C16ECC1B92334600C81079 /* MediaPlayer.framework */, + 45855BB21B88FB48008B61B8 /* QuartzCore.framework */, 8D05375A1B86687B00588318 /* Time */, + 45C9BBED1B954B6A009001E2 /* Sounds */, 8D0537741B86687C00588318 /* TimeTests */, 8D0537591B86687B00588318 /* Products */, ); @@ -83,10 +131,24 @@ children = ( 8D05375F1B86687C00588318 /* AppDelegate.h */, 8D0537601B86687C00588318 /* AppDelegate.m */, - 8D0537621B86687C00588318 /* ViewController.h */, - 8D0537631B86687C00588318 /* ViewController.m */, - 8D0537651B86687C00588318 /* Main.storyboard */, - 8D0537681B86687C00588318 /* Images.xcassets */, + 45855BAC1B86A2A3008B61B8 /* StopwatchViewController.h */, + 45855BAD1B86A2A3008B61B8 /* StopwatchViewController.m */, + 45855BAF1B86A2BB008B61B8 /* TimerViewController.h */, + 45855BB01B86A2BB008B61B8 /* TimerViewController.m */, + 009067F91B8FE7E700BCBF71 /* PresetTimerTableViewController.h */, + 009067FC1B8FF8E200BCBF71 /* PresetTimerTableViewController.m */, + 009068361B9250F200BCBF71 /* TimerData.h */, + 009068371B92518900BCBF71 /* TimerData.m */, + 003B483F1B8A322E004C430A /* SpecialEventViewController.h */, + 003B48401B8A322E004C430A /* SpecialEventViewController.m */, + 45C9BBAC1B938D7A009001E2 /* WorldClockInfo.h */, + 45C9BBAD1B938D7A009001E2 /* WorldClockInfo.m */, + 45C9BBAF1B938E28009001E2 /* NewWorldClockTableViewController.h */, + 45C9BBB01B938E28009001E2 /* NewWorldClockTableViewController.m */, + 45C600BB1B8A475C004C6714 /* WorldClockTableViewController.h */, + 45C600BC1B8A475C004C6714 /* WorldClockTableViewController.m */, + 003B48371B88CEC8004C430A /* Main.storyboard */, + 003B48421B8A4DE7004C430A /* Images .xcassets */, 8D05376A1B86687C00588318 /* LaunchScreen.xib */, 8D05375B1B86687B00588318 /* Supporting Files */, ); @@ -199,9 +261,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8D0537671B86687C00588318 /* Main.storyboard in Resources */, + 45E331B61B969774005D6871 /* Video.mp4 in Resources */, + 003B48381B88CEC8004C430A /* Main.storyboard in Resources */, + 45E331B41B968923005D6871 /* Wat.mp3 in Resources */, 8D05376C1B86687C00588318 /* LaunchScreen.xib in Resources */, - 8D0537691B86687C00588318 /* Images.xcassets in Resources */, + 003B48431B8A4DE7004C430A /* Images .xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -219,9 +283,17 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8D0537641B86687C00588318 /* ViewController.m in Sources */, + 45E331F01B96A2BF005D6871 /* Video.mp4 in Sources */, + 45C9BBB11B938E28009001E2 /* NewWorldClockTableViewController.m in Sources */, + 45855BB11B86A2BB008B61B8 /* TimerViewController.m in Sources */, 8D0537611B86687C00588318 /* AppDelegate.m in Sources */, + 009067FD1B8FF8E200BCBF71 /* PresetTimerTableViewController.m in Sources */, + 009068381B92518900BCBF71 /* TimerData.m in Sources */, + 003B48411B8A322E004C430A /* SpecialEventViewController.m in Sources */, 8D05375E1B86687C00588318 /* main.m in Sources */, + 45C600BD1B8A475C004C6714 /* WorldClockTableViewController.m in Sources */, + 45855BAE1B86A2A3008B61B8 /* StopwatchViewController.m in Sources */, + 45C9BBAE1B938D7A009001E2 /* WorldClockInfo.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -244,14 +316,6 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 8D0537651B86687C00588318 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8D0537661B86687C00588318 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; 8D05376A1B86687C00588318 /* LaunchScreen.xib */ = { isa = PBXVariantGroup; children = ( @@ -418,6 +482,7 @@ 8D05377D1B86687C00588318 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 8D05377E1B86687C00588318 /* Build configuration list for PBXNativeTarget "TimeTests" */ = { isa = XCConfigurationList; @@ -426,6 +491,7 @@ 8D0537801B86687C00588318 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Time/Time.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Time/Time.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 85e10aa..919434a 100644 --- a/Time/Time.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/Time/Time.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/Time/Time/Base.lproj/LaunchScreen.xib b/Time/Time/Base.lproj/LaunchScreen.xib index f9a54ff..29eb2f2 100644 --- a/Time/Time/Base.lproj/LaunchScreen.xib +++ b/Time/Time/Base.lproj/LaunchScreen.xib @@ -1,8 +1,7 @@ - + - - + @@ -11,31 +10,25 @@ - - + + + + + + + - + - - - - - - + + + + + diff --git a/Time/Time/Base.lproj/Main.storyboard b/Time/Time/Base.lproj/Main.storyboard deleted file mode 100644 index f56d2f3..0000000 --- a/Time/Time/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Time/Time/Images.xcassets/AppIcon.appiconset/Contents.json b/Time/Time/Images .xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Time/Time/Images.xcassets/AppIcon.appiconset/Contents.json rename to Time/Time/Images .xcassets/AppIcon.appiconset/Contents.json 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/Countdown.imageset/146-512.png b/Time/Time/Images .xcassets/Countdown.imageset/146-512.png new file mode 100644 index 0000000..d9db8b4 Binary files /dev/null and b/Time/Time/Images .xcassets/Countdown.imageset/146-512.png differ diff --git a/Time/Time/Images .xcassets/Countdown.imageset/Contents.json b/Time/Time/Images .xcassets/Countdown.imageset/Contents.json new file mode 100644 index 0000000..729b643 --- /dev/null +++ b/Time/Time/Images .xcassets/Countdown.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "146-512.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/Rain.imageset/Contents.json b/Time/Time/Images .xcassets/Rain.imageset/Contents.json new file mode 100644 index 0000000..3fbbbaa --- /dev/null +++ b/Time/Time/Images .xcassets/Rain.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "jamaican-rain.jpg" + }, + { + "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/Rain.imageset/jamaican-rain.jpg b/Time/Time/Images .xcassets/Rain.imageset/jamaican-rain.jpg new file mode 100644 index 0000000..685ace3 Binary files /dev/null and b/Time/Time/Images .xcassets/Rain.imageset/jamaican-rain.jpg differ diff --git a/Time/Time/Images .xcassets/Speaker.imageset/Contents.json b/Time/Time/Images .xcassets/Speaker.imageset/Contents.json new file mode 100644 index 0000000..f87fd8e --- /dev/null +++ b/Time/Time/Images .xcassets/Speaker.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "sound_on-512.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/Speaker.imageset/sound_on-512.png b/Time/Time/Images .xcassets/Speaker.imageset/sound_on-512.png new file mode 100644 index 0000000..f242e29 Binary files /dev/null and b/Time/Time/Images .xcassets/Speaker.imageset/sound_on-512.png differ diff --git a/Time/Time/Images .xcassets/StopWatch.imageset/Contents.json b/Time/Time/Images .xcassets/StopWatch.imageset/Contents.json new file mode 100644 index 0000000..d1f48b7 --- /dev/null +++ b/Time/Time/Images .xcassets/StopWatch.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "StopWatch-256.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.imageset/StopWatch-256.png b/Time/Time/Images .xcassets/StopWatch.imageset/StopWatch-256.png new file mode 100644 index 0000000..8073568 Binary files /dev/null and b/Time/Time/Images .xcassets/StopWatch.imageset/StopWatch-256.png differ diff --git a/Time/Time/Images .xcassets/Timer Background.imageset/Contents.json b/Time/Time/Images .xcassets/Timer Background.imageset/Contents.json new file mode 100644 index 0000000..db52e15 --- /dev/null +++ b/Time/Time/Images .xcassets/Timer Background.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Timer Background.jpeg" + }, + { + "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 Background.imageset/Timer Background.jpeg b/Time/Time/Images .xcassets/Timer Background.imageset/Timer Background.jpeg new file mode 100644 index 0000000..345a443 Binary files /dev/null and b/Time/Time/Images .xcassets/Timer Background.imageset/Timer Background.jpeg differ diff --git a/Time/Time/Images .xcassets/Timer-25.imageset/Contents.json b/Time/Time/Images .xcassets/Timer-25.imageset/Contents.json new file mode 100644 index 0000000..a0c53dd --- /dev/null +++ b/Time/Time/Images .xcassets/Timer-25.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Timer-25.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-25.imageset/Timer-25.png b/Time/Time/Images .xcassets/Timer-25.imageset/Timer-25.png new file mode 100644 index 0000000..1f09f4a Binary files /dev/null and b/Time/Time/Images .xcassets/Timer-25.imageset/Timer-25.png differ diff --git a/Time/Time/Images .xcassets/beach.imageset/Contents.json b/Time/Time/Images .xcassets/beach.imageset/Contents.json new file mode 100644 index 0000000..f88e521 --- /dev/null +++ b/Time/Time/Images .xcassets/beach.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "beach.jpg" + }, + { + "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/beach.imageset/beach.jpg b/Time/Time/Images .xcassets/beach.imageset/beach.jpg new file mode 100644 index 0000000..b0de1bd Binary files /dev/null and b/Time/Time/Images .xcassets/beach.imageset/beach.jpg differ diff --git a/Time/Time/Images .xcassets/chris.imageset/Contents.json b/Time/Time/Images .xcassets/chris.imageset/Contents.json new file mode 100644 index 0000000..319fa36 --- /dev/null +++ b/Time/Time/Images .xcassets/chris.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "chris.jpg" + }, + { + "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/chris.imageset/chris.jpg b/Time/Time/Images .xcassets/chris.imageset/chris.jpg new file mode 100644 index 0000000..2d220c2 Binary files /dev/null and b/Time/Time/Images .xcassets/chris.imageset/chris.jpg differ diff --git a/Time/Time/Images .xcassets/launch.imageset/Contents.json b/Time/Time/Images .xcassets/launch.imageset/Contents.json new file mode 100644 index 0000000..47a03f0 --- /dev/null +++ b/Time/Time/Images .xcassets/launch.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "clock-8-00-transparent-md.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/launch.imageset/clock-8-00-transparent-md.png b/Time/Time/Images .xcassets/launch.imageset/clock-8-00-transparent-md.png new file mode 100644 index 0000000..621a2e6 Binary files /dev/null and b/Time/Time/Images .xcassets/launch.imageset/clock-8-00-transparent-md.png differ diff --git a/Time/Time/Images .xcassets/locked.imageset/Contents.json b/Time/Time/Images .xcassets/locked.imageset/Contents.json new file mode 100644 index 0000000..fa73a1e --- /dev/null +++ b/Time/Time/Images .xcassets/locked.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "locked-video-placeholder-2.jpg" + }, + { + "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/locked.imageset/locked-video-placeholder-2.jpg b/Time/Time/Images .xcassets/locked.imageset/locked-video-placeholder-2.jpg new file mode 100644 index 0000000..65ff020 Binary files /dev/null and b/Time/Time/Images .xcassets/locked.imageset/locked-video-placeholder-2.jpg differ diff --git a/Time/Time/Images .xcassets/nyc.imageset/Contents.json b/Time/Time/Images .xcassets/nyc.imageset/Contents.json new file mode 100644 index 0000000..9f8c721 --- /dev/null +++ b/Time/Time/Images .xcassets/nyc.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "nyc.jpeg" + }, + { + "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/nyc.imageset/nyc.jpeg b/Time/Time/Images .xcassets/nyc.imageset/nyc.jpeg new file mode 100644 index 0000000..b6ecb8a Binary files /dev/null and b/Time/Time/Images .xcassets/nyc.imageset/nyc.jpeg differ diff --git a/Time/Time/Images .xcassets/street.imageset/11899858_10101734315509721_4702252424480397124_n.jpg b/Time/Time/Images .xcassets/street.imageset/11899858_10101734315509721_4702252424480397124_n.jpg new file mode 100644 index 0000000..56488a1 Binary files /dev/null and b/Time/Time/Images .xcassets/street.imageset/11899858_10101734315509721_4702252424480397124_n.jpg differ diff --git a/Time/Time/Images .xcassets/street.imageset/Contents.json b/Time/Time/Images .xcassets/street.imageset/Contents.json new file mode 100644 index 0000000..90ef7b5 --- /dev/null +++ b/Time/Time/Images .xcassets/street.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "11899858_10101734315509721_4702252424480397124_n.jpg" + }, + { + "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/track.imageset/Contents.json b/Time/Time/Images .xcassets/track.imageset/Contents.json new file mode 100644 index 0000000..37ff624 --- /dev/null +++ b/Time/Time/Images .xcassets/track.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "big_thumb_8dbc5f032732b5001f3f2c61237a4906.jpg" + }, + { + "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/track.imageset/big_thumb_8dbc5f032732b5001f3f2c61237a4906.jpg b/Time/Time/Images .xcassets/track.imageset/big_thumb_8dbc5f032732b5001f3f2c61237a4906.jpg new file mode 100644 index 0000000..f1359bb Binary files /dev/null and b/Time/Time/Images .xcassets/track.imageset/big_thumb_8dbc5f032732b5001f3f2c61237a4906.jpg differ diff --git a/Time/Time/Images .xcassets/world.imageset/Contents.json b/Time/Time/Images .xcassets/world.imageset/Contents.json new file mode 100644 index 0000000..8ded5e0 --- /dev/null +++ b/Time/Time/Images .xcassets/world.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "world-512.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/world.imageset/world-512.png b/Time/Time/Images .xcassets/world.imageset/world-512.png new file mode 100644 index 0000000..b9c0f8d Binary files /dev/null and b/Time/Time/Images .xcassets/world.imageset/world-512.png differ diff --git a/Time/Time/Images.xcassets/World.imageset/Contents.json b/Time/Time/Images.xcassets/World.imageset/Contents.json new file mode 100644 index 0000000..8ded5e0 --- /dev/null +++ b/Time/Time/Images.xcassets/World.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "world-512.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/World.imageset/world-512.png b/Time/Time/Images.xcassets/World.imageset/world-512.png new file mode 100644 index 0000000..b9c0f8d Binary files /dev/null and b/Time/Time/Images.xcassets/World.imageset/world-512.png differ diff --git a/Time/Time/Main.storyboard b/Time/Time/Main.storyboard new file mode 100644 index 0000000..68ee460 --- /dev/null +++ b/Time/Time/Main.storyboard @@ -0,0 +1,825 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Time/Time/NewWorldClockTableViewController.h b/Time/Time/NewWorldClockTableViewController.h new file mode 100644 index 0000000..12aee56 --- /dev/null +++ b/Time/Time/NewWorldClockTableViewController.h @@ -0,0 +1,13 @@ +// +// NewWorldClockTableViewController.h +// Time +// +// Created by Chris David on 8/30/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface NewWorldClockTableViewController : UITableViewController +@property (nonatomic) NSMutableArray *selectedCitiesArray; +@end diff --git a/Time/Time/NewWorldClockTableViewController.m b/Time/Time/NewWorldClockTableViewController.m new file mode 100644 index 0000000..48881be --- /dev/null +++ b/Time/Time/NewWorldClockTableViewController.m @@ -0,0 +1,168 @@ +// +// NewWorldClockTableViewController.m +// Time +// +// Created by Chris David on 8/30/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "NewWorldClockTableViewController.h" +#import "WorldClockInfo.h" +#import "WorldClockTableViewController.h" + +@interface NewWorldClockTableViewController () +@property (nonatomic) NSArray *keyArray; +@property (nonatomic) NSArray *valueArray; + +@property (nonatomic) NSString* city ; +@property (nonatomic) NSString* time; + +@property (nonatomic) NSMutableDictionary *clock; +@property (strong, nonatomic) NSArray *searchResults; +@end + +@implementation NewWorldClockTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + [self.navigationItem setTitle:@"Add City"]; + + + self.clock = [[NSMutableDictionary alloc] init]; + self.searchResults = [[NSArray alloc] init]; + self.keyArray = [[NSArray alloc] init]; + + + ////// trying to get current time + NSDate * now = [NSDate date]; + + NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; + [outputFormatter setDateFormat:@"HH:mm"]; + + NSString *NYTimeString = [outputFormatter stringFromDate:now]; + + NSDate *parisTime = [now dateByAddingTimeInterval:21600]; // Add XXX seconds to *now + NSString *ParisTimeString = [outputFormatter stringFromDate:parisTime]; + + + NSDate *RomeTime = [now dateByAddingTimeInterval:21600]; + NSString *RomeTimeString = [outputFormatter stringFromDate:RomeTime]; + + + NSDate *Seattle = [now dateByAddingTimeInterval:-3600]; + NSString *SeattleTimeString = [outputFormatter stringFromDate:Seattle]; + + + + NSDate *NewJersey = [now dateByAddingTimeInterval:34200]; + NSString *NewJerseyTimeString = [outputFormatter stringFromDate:NewJersey]; + + + + + + + [self.clock setObject:NewJerseyTimeString forKey:@"New Jersey"]; + [self.clock setObject:SeattleTimeString forKey:@"Seattle"]; + [self.clock setObject:NYTimeString forKey:@"New York"]; + [self.clock setObject:RomeTimeString forKey:@"Rome, Italy"]; + [self.clock setObject:ParisTimeString forKey:@"Paris, France"]; + + + self.keyArray = [self.clock allKeys]; + self.valueArray = [self.clock allValues]; + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + if (tableView == self.searchDisplayController.searchResultsTableView) { + return [self.searchResults count]; + } + else + return [self.keyArray count]; + +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + static NSString *cellID = @"NewWorldClockIdentifier"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID ]; + if (cell == nil) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; + + } + + + if (tableView == self.searchDisplayController.searchResultsTableView) { + cell.textLabel.text = [self.searchResults objectAtIndex:indexPath.row]; + + } + else { + [cell.textLabel setText:[self.keyArray objectAtIndex:indexPath.row]]; + + } + + return cell; +} +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSLog(@"%@ %@", self.keyArray[(long)indexPath.row], self.valueArray[(long)indexPath.row] ); // you can see + + + WorldClockInfo *city = [[WorldClockInfo alloc] init]; + city.cityName = self.keyArray[indexPath.row]; + city.cityTime = self.valueArray[indexPath.row]; + + WorldClockInfo *citySelected = [[WorldClockInfo alloc] init]; + city.cityName = self.searchResults[indexPath.row]; + + + if (tableView == self.searchDisplayController.searchResultsTableView) { + [self.selectedCitiesArray addObject: citySelected]; + + } + else { + [self.selectedCitiesArray addObject:city ]; + // [self.clock removeObjectForKey:city.cityName]; + } + + [[self navigationController] popViewControllerAnimated:YES]; + [self.tableView reloadData]; + +} +-(void) filterContentForSearchText: (NSString *)searchText scope:(NSString *)scope{ + NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] %@",searchText]; + + self.searchResults = [self.keyArray filteredArrayUsingPredicate:predicate]; +} + + +-(BOOL) searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { + + [self filterContentForSearchText:searchString scope:[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]]; + + return YES; +} + +- (void)tableView: (UITableView*)tableView + willDisplayCell: (UITableViewCell*)cell +forRowAtIndexPath: (NSIndexPath*)indexPath +{ + cell.backgroundColor = indexPath.row % 2 + ? [UIColor colorWithRed:0.87 green:0.93 blue:0.98 alpha:1.0] + : [UIColor whiteColor]; + +} + +@end diff --git a/Time/Time/PresetTimerTableViewController.h b/Time/Time/PresetTimerTableViewController.h new file mode 100644 index 0000000..041ef09 --- /dev/null +++ b/Time/Time/PresetTimerTableViewController.h @@ -0,0 +1,25 @@ +// +// PresetTimerTableViewController.h +// Time +// +// Created by Felicia Weathers on 8/27/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import +#import "TimerData.h" + +@interface PresetTimerTableViewController : UITableViewController + + +@property (nonatomic) TimerData *selectedPreset; + +- (IBAction)backButton:(id)sender; + +- (IBAction)addButton:(id)sender; + +@property (nonatomic) UIViewController *timerVC; + + + +@end diff --git a/Time/Time/PresetTimerTableViewController.m b/Time/Time/PresetTimerTableViewController.m new file mode 100644 index 0000000..b38ba46 --- /dev/null +++ b/Time/Time/PresetTimerTableViewController.m @@ -0,0 +1,132 @@ +// +// PresetTimerTableViewController.m +// Time +// +// Created by Felicia Weathers on 8/27/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "PresetTimerTableViewController.h" + +@interface PresetTimerTableViewController () + +@property (nonatomic) NSMutableArray *presets; + +@end + +@implementation PresetTimerTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.presets = [[NSMutableArray alloc]init]; + + TimerData *cardio = [[TimerData alloc]init]; + cardio.nameOfTimer = @"Cardio"; + cardio.presetTime = @30.00; + + TimerData *strengthTraining = [[TimerData alloc]init]; + strengthTraining.nameOfTimer = @"Strength Training"; + strengthTraining.presetTime = @45.00; + + TimerData *yoga = [[TimerData alloc]init]; + yoga.nameOfTimer = @"Yoga"; + yoga.presetTime = @90.00; + + + + self.presets = [NSMutableArray arrayWithObjects: cardio, strengthTraining, yoga, nil]; + + self.clearsSelectionOnViewWillAppear = NO; + + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + // Return the number of sections. + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + // Return the number of rows in the section. + return self.presets.count; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + + self.selectedPreset = self.presets[indexPath.row]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PresetTimerIdentifier" forIndexPath:indexPath]; + + NSArray *presetData = [self.presets valueForKey:@"nameOfTimer"]; + NSString *name = presetData[indexPath.row]; + + cell.textLabel.text = name; + + return cell; +} + + +/* +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the specified item to be editable. + return YES; +} +*/ + +/* +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [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 + } +} +*/ + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { +} +*/ + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + NSArray *presetData = [self.presets valueForKey:@"nameOfTimer"]; + NSString *name = presetData[indexPath.row]; + + +} + +- (IBAction)backButton:(id)sender { + + [self dismissViewControllerAnimated:YES completion:nil]; + +} + +- (IBAction)addButton:(id)sender { + +} +@end diff --git a/Time/Time/SpecialEventViewController.h b/Time/Time/SpecialEventViewController.h new file mode 100644 index 0000000..2c2eaca --- /dev/null +++ b/Time/Time/SpecialEventViewController.h @@ -0,0 +1,28 @@ +// +// SpecialEventViewController.h +// Time +// +// Created by Felicia Weathers on 8/23/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface SpecialEventViewController : UIViewController { + NSTimer *timer; +} + + +@property (weak, nonatomic) IBOutlet UIScrollView *scrollView; +@property (weak, nonatomic) IBOutlet UIDatePicker *datePicker; +@property (weak, nonatomic) IBOutlet UILabel *countdownLabel; +@property (weak, nonatomic) IBOutlet UILabel *titleLabel; +@property (weak, nonatomic) IBOutlet UITextField *titleTextField; +- (IBAction)titleTextFiled2:(id)sender; + +- (IBAction)startButton:(id)sender; +- (IBAction)resetButton:(id)sender; + +@property (weak, nonatomic) IBOutlet UIButton *goButton; + +@end diff --git a/Time/Time/SpecialEventViewController.m b/Time/Time/SpecialEventViewController.m new file mode 100644 index 0000000..7d6d40f --- /dev/null +++ b/Time/Time/SpecialEventViewController.m @@ -0,0 +1,89 @@ +// +// SpecialEventViewController.m +// Time +// +// Created by Felicia Weathers on 8/23/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "SpecialEventViewController.h" + +@implementation SpecialEventViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + //set scrollable image background + UIImage *backgroundImage = [UIImage imageNamed:@"beach"]; + UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage]; + self.scrollView.contentSize = backgroundImage.size; + [self.scrollView addSubview:backgroundImageView]; + + + //countdown label1 Custom Design + self.countdownLabel.layer.borderColor = [UIColor whiteColor].CGColor; + self.countdownLabel.layer.borderWidth = 0.5; + self.countdownLabel.layer.cornerRadius = 15; + + //title label design + self.titleLabel.layer.cornerRadius = 37.5; + self.titleLabel.layer.borderColor = [UIColor whiteColor].CGColor; + self.titleLabel.layer.borderWidth = 1.0; + self.titleLabel.clipsToBounds = YES; + +} + +- (IBAction)titleTextFiled2:(id)sender { + + self.titleLabel.text = [self.titleTextField text]; + +} + +- (IBAction)startButton:(id)sender { + + NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar]; + NSUInteger preservedComponents = (NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay); + + self.datePicker.hidden = YES; + self.titleLabel.hidden = NO; + self.titleTextField.hidden = YES; + self.countdownLabel.hidden = NO; + + self.datePicker.date = [calendar dateFromComponents:[calendar components:preservedComponents fromDate:self.datePicker.date]]; + + self.datePicker.hidden = YES; + self.titleTextField.hidden = YES; + timer = [NSTimer scheduledTimerWithTimeInterval:1.0 + target:self + selector:@selector(updateTime) + userInfo:nil + repeats:YES]; + +// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Today is the Day!" message:@"You're countdown is complet" delegate:self cancelButtonTitle:@"Clear" otherButtonTitles: nil]; +// [alert show]; + + + + + +} + +-(void)updateTime +{ + + NSInteger ti = ((NSInteger)[self.datePicker.date timeIntervalSinceNow]); + NSInteger seconds = ti % 60; + NSInteger minutes = (ti / 60) % 60; + NSInteger hours = (ti / 3600) % 24; + NSInteger days = (ti / 86400); + + self.countdownLabel.text = [NSString stringWithFormat:@"%02li days %02li hrs %02li min %02li sec", (long)days, (long)hours, (long)minutes, (long)seconds]; +} +- (IBAction)resetButton:(id)sender { + [timer invalidate]; + self.countdownLabel.text = @"00 days 00 hrs 00 min 00 sec"; + self.datePicker.hidden = NO; + self.titleLabel.hidden = YES; + self.titleTextField.hidden = NO; + self.countdownLabel.hidden = YES; +} +@end diff --git a/Time/Time/StopwatchViewController.h b/Time/Time/StopwatchViewController.h new file mode 100644 index 0000000..fd871ef --- /dev/null +++ b/Time/Time/StopwatchViewController.h @@ -0,0 +1,31 @@ +// +// StopwatchViewController.h +// Time +// +// Created by Chris David on 8/20/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import +#import +#import + +@interface StopwatchViewController : UIViewController + + + + +@property (weak, nonatomic) IBOutlet UILabel *stopwatchLabel; +@property (weak, nonatomic) IBOutlet UILabel *lapLabel; +@property (weak, nonatomic) IBOutlet UITableView *lapTableView; +@property (strong, nonatomic) NSMutableArray *dataArray; + +- (IBAction)startButton:(id)sender; +- (IBAction)resetButton:(id)sender; + + +- (void)updateTimer; +- (void)rememberTimer; + + +@end diff --git a/Time/Time/StopwatchViewController.m b/Time/Time/StopwatchViewController.m new file mode 100644 index 0000000..3ecd6ed --- /dev/null +++ b/Time/Time/StopwatchViewController.m @@ -0,0 +1,310 @@ +// +// StopwatchViewController.m +// Time +// +// Created by Chris David on 8/20/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "StopwatchViewController.h" +#import +#import +#import + +@interface StopwatchViewController () +- (void)configureView; +//Music Player +@property (nonatomic)AVAudioPlayer *myMusic; + +//Video Player +@property (nonatomic)MPMoviePlayerController *myPlayer; +//UI Buttons and Views +@property (weak, nonatomic) IBOutlet UIScrollView *scrollView; +@property (weak, nonatomic) IBOutlet UIButton *startButton; +@property (weak, nonatomic) IBOutlet UIButton *resetButton; +- (IBAction)soundButton:(id)sender; +//Timers and stuff +@property (nonatomic) NSTimer *stopTimer; +@property (nonatomic) NSTimer *lapTimer; +@property (nonatomic) NSDate *startDate; +@property (nonatomic) NSDate *previousFireDate; +@property (nonatomic) NSDate *restartDate; +@property (nonatomic) BOOL running; + + +@property (nonatomic) NSTimeInterval pauseTimeInterval; +@property (nonatomic) NSTimeInterval totalElapsedTime; +@property (nonatomic) NSTimeInterval totalLapTime; + +@property (nonatomic) NSDate *previousTime; +@property (nonatomic) NSDate *previousLapTime; + + + +@end + +@implementation StopwatchViewController + + +- (void)viewDidLoad { + [super viewDidLoad]; + //Start Lablels Display on Screen + self.stopwatchLabel.text = @"00.00.00"; + self.lapLabel.text =@"00.00.00"; + self.running = FALSE; + + //Stop Watch Label Custom Design + + self.stopwatchLabel.layer.borderColor = [UIColor whiteColor].CGColor; + self.stopwatchLabel.layer.borderWidth = 0.5; + self.stopwatchLabel.layer.cornerRadius = 15; + //Start Button + + self.startButton.layer.cornerRadius = 37.5; + self.startButton.layer.borderColor = [UIColor grayColor].CGColor; + self.startButton.layer.borderWidth = 1.0; + self.startButton.clipsToBounds = YES; + + //Reset Button + + self.resetButton.layer.cornerRadius = 37.5; + self.resetButton.layer.borderColor = [UIColor grayColor].CGColor; + self.resetButton.layer.borderWidth = 1.0; + self.resetButton.clipsToBounds = YES; + + //Lap Table View At the Buttom + + self.lapTableView.layer.borderColor = [UIColor whiteColor].CGColor; + self.lapTableView.layer.borderWidth = 0.5; + [[UITabBar appearance] setTintColor:[UIColor whiteColor]]; + [[UITabBar appearance] setBarTintColor:[UIColor blackColor]]; + self.scrollView.contentInset = UIEdgeInsetsZero; + + + // Initialize Date + [self configureView]; + + // Scroll Image in background + +// UIImage *backgroundImage = [UIImage imageNamed:@"track"]; +// UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage]; +// self.scrollView.contentSize = backgroundImage.size; +// [self.scrollView addSubview:backgroundImageView]; +// + // Music + // Construct URL to sound file + NSString *path = [NSString stringWithFormat:@"%@/Wat.mp3", [[NSBundle mainBundle] resourcePath]]; + NSURL *soundUrl = [NSURL fileURLWithPath:path]; + self.myMusic = [[AVAudioPlayer alloc] initWithContentsOfURL:soundUrl error:nil]; + + //Video in Background + NSURL *videoURL = [[NSBundle mainBundle] URLForResource:@"Video" withExtension:@"mp4"]; + self.myPlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL]; + self.myPlayer.controlStyle = MPMovieControlStyleNone; + //[self.myPlayer prepareToPlay]; + [self.myPlayer.view setFrame: CGRectMake(0, -500, 2000, 1600)]; + [self.view addSubview:self.myPlayer.view]; + [self.view sendSubviewToBack:self.myPlayer.view]; +} + +- (void)configureView +{ + self.dataArray = [[NSMutableArray alloc] init]; +} + //WHEN START BUTTON IS TAPPED +- (IBAction)startButton:(id)sender { + + if(!self.running) { + //When App is Not running, Run app and perform these things + self.previousTime = [NSDate date]; + self.previousLapTime = [NSDate date]; + + [self.myMusic play]; +[self.myPlayer prepareToPlay]; + [self.myPlayer play]; + + + [self startTimer]; + self.running = TRUE; + } else{ + [self pauseTimer]; + self.running = NO; + + [self.myMusic pause]; + [self.myPlayer pause]; + } + +} + +- (void)startTimer { + // change the + [self.startButton setTitle:@"Pause" forState:UIControlStateNormal]; + [self.resetButton setTitle:@"Lap" forState:UIControlStateNormal]; + + self.stopTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/10.0 + target:self + selector:@selector(updateTimer) + userInfo:nil + repeats:YES]; + self.lapTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/10.0 + target:self + selector:@selector(rememberTimer) + userInfo:nil + repeats:YES]; + + +} + +- (void)pauseTimer { + + + if(!self.running){ + self.running = TRUE; + + [self.resetButton setTitle:@"Lap" forState:UIControlStateNormal]; + + if (self.stopTimer == nil && self.lapTimer == nil) { + self.stopTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/10.0 + target:self + selector:@selector(updateTimer) + userInfo:nil + repeats:YES]; + self.lapTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/10.0 + target:self + selector:@selector(rememberTimer) + userInfo:nil + repeats:YES]; + + } + }else{ + self.running = FALSE; + + [self.resetButton setTitle:@"Reset" forState:UIControlStateNormal]; + [self.stopTimer invalidate]; + self.stopTimer = nil; + [self.lapTimer invalidate]; + self.lapTimer = nil; + + + + + } + + + [self.startButton setTitle:@"Start" forState:UIControlStateNormal]; + [self.resetButton setTitle:@"Reset" forState:UIControlStateNormal]; + + [self.stopTimer invalidate]; + [self.lapTimer invalidate]; + + self.stopTimer = nil; + self.lapTimer = nil; + +} + +-(void)updateTimer{ + + NSDate *currentDate = [NSDate date]; + NSTimeInterval totalElapsedTime = [[NSDate date] timeIntervalSinceDate:self.previousTime]; + NSTimeInterval lapElapsedTime = [[NSDate date] timeIntervalSinceDate:self.previousLapTime]; + self.previousTime = currentDate; + self.previousLapTime = currentDate; + + self.totalElapsedTime += totalElapsedTime; + self.totalLapTime += lapElapsedTime; + + self.lapLabel.text = [self formattedTime:self.totalLapTime]; + self.stopwatchLabel.text = [self formattedTime:self.totalElapsedTime]; + + +} + +- (NSString *)formattedTime:(NSTimeInterval)time { + //NSTimeInterval wrappedSeconds = fmod(time, 60.0); + NSTimeInterval minutes = floor(time / 60); + + + return [NSString stringWithFormat:@"%0.2f:%0.2f",minutes, time]; +} + +-(void)rememberTimer{ + + +} + + +- (IBAction)resetButton:(id)sender { + // set totalElapsedTime = 0 + // invalidate all timers + // reload lap table view with empty array + + + + + if (self.running) { + + [self.dataArray addObject:[NSString stringWithFormat:@"%.02f", self.totalLapTime]]; + self.totalLapTime = 0; + self.previousLapTime = [NSDate date]; + [self.lapTableView reloadData]; + + + }else{ + self.totalElapsedTime = 0; + self.totalLapTime = 0; + + [self.startButton setTitle:@"Start" forState:UIControlStateNormal]; + [self.stopTimer invalidate]; + [self.lapTimer invalidate]; + self.stopwatchLabel.text = @"00.00.00"; + self.lapLabel.text = @"00.00.00"; + [self.dataArray removeAllObjects]; + [self.lapTableView reloadData]; + self.myMusic.currentTime = 0; + self.myPlayer.currentPlaybackTime = 0; + + } + +} + + + + + + +// Segue + + + + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return [self.dataArray count]; +} +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *labelID = @"LapLabelCellIdentifier"; + + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:labelID]; + + if (!cell) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:labelID]; + } + cell.detailTextLabel.text = [self.dataArray objectAtIndex: [self.dataArray count] - indexPath.row - 1]; + + NSString *rowCounter = [NSString stringWithFormat:@"Lap %ld",[self.dataArray count] -(long)indexPath.row]; + cell.textLabel.text = rowCounter; + + return cell; +} + + + + +- (IBAction)soundButton:(id)sender { + + self.myMusic.volume = 0; + +} +@end diff --git a/Time/Time/TimerData.h b/Time/Time/TimerData.h new file mode 100644 index 0000000..ac8c969 --- /dev/null +++ b/Time/Time/TimerData.h @@ -0,0 +1,19 @@ +// +// TimerData.h +// Time +// +// Created by Felicia Weathers on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface TimerData : NSObject + +@property (nonatomic) NSMutableArray *presets; + + +@property (nonatomic)NSString *nameOfTimer; +@property (nonatomic)NSNumber *presetTime; + +@end diff --git a/Time/Time/TimerData.m b/Time/Time/TimerData.m new file mode 100644 index 0000000..923dcad --- /dev/null +++ b/Time/Time/TimerData.m @@ -0,0 +1,30 @@ +// +// TimerData.m +// Time +// +// Created by Felicia Weathers on 8/29/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "TimerData.h" + +@implementation TimerData + +- (void)setUpPresetData { + + self.presets = [[NSMutableArray alloc]init]; + + TimerData *cardio = [[TimerData alloc]init]; + cardio.nameOfTimer = @"Cardio"; + cardio.presetTime = @30.00; + + TimerData *strengthTraining = [[TimerData alloc]init]; + strengthTraining.nameOfTimer = @"Strength Training"; + strengthTraining.presetTime = @45.00; + + TimerData *yoga = [[TimerData alloc]init]; + yoga.nameOfTimer = @"Yoga"; + yoga.presetTime = @90.00; + +} +@end diff --git a/Time/Time/TimerViewController.h b/Time/Time/TimerViewController.h new file mode 100644 index 0000000..3360a41 --- /dev/null +++ b/Time/Time/TimerViewController.h @@ -0,0 +1,29 @@ +// +// TimerViewController.h +// Time +// +// Created by Chris David on 8/20/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface TimerViewController : UIViewController +{ + NSTimer *countdownTimer; +} + +@property (weak, nonatomic) IBOutlet UIDatePicker *datePicker; +@property (weak, nonatomic) IBOutlet UILabel *countdownLabel; + +@property (nonatomic) NSMutableArray *presets; + +- (IBAction)startCountdown:(id)sender; +- (IBAction)restartButton:(id)sender; + +- (IBAction)presetButton:(id)sender; + + + + +@end diff --git a/Time/Time/TimerViewController.m b/Time/Time/TimerViewController.m new file mode 100644 index 0000000..c1cead5 --- /dev/null +++ b/Time/Time/TimerViewController.m @@ -0,0 +1,120 @@ +// +// TimerViewController.m +// Time +// +// Created by Chris David on 8/20/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "TimerViewController.h" +#import "PresetTimerTableViewController.h" + +@interface TimerViewController () +@property (weak, nonatomic) IBOutlet UIScrollView *scrollView; + +@property (nonatomic) NSInteger afterRemainder; +@property (nonatomic) NSInteger Remainder; +@property (nonatomic) NSTimeInterval countDownInterval; + +@property (nonatomic) NSTimer *startTimer; +@property (nonatomic) NSTimer *pauseTimer; +@property (nonatomic) NSDate *previousTime; + + +//@property (nonatomic) TimerData *presetInterval; //this is what i will pass to the preset view and then pass back once a preset timer is chosen +// + +@property (nonatomic) BOOL running; +@property (weak, nonatomic) IBOutlet UIButton *startButton; + +@property (weak, nonatomic) IBOutlet UIButton *restartButton; +@end + +@implementation TimerViewController + + + +- (void)viewDidLoad { + [super viewDidLoad]; + self.running = NO; + self.Remainder = -1; + + UIImage *backgroundImage = [UIImage imageNamed:@"track"]; + UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage]; + self.scrollView.contentSize = backgroundImage.size; + [self.scrollView addSubview:backgroundImageView]; + + + + // self.presetInterval = [[TimerData alloc]init]; + // self.presetInterval.presetTime = @00.00; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +-(void)updateTime { + self.afterRemainder --; + + NSInteger hours = (NSInteger)(self.afterRemainder/(60*60)); + NSInteger minutes = (((NSInteger)self.afterRemainder/60) - (hours *60)); + NSInteger seconds = (((NSInteger)self.afterRemainder - (60 * minutes) - (60 * hours *60))); + NSString *displayText = [[NSString alloc] initWithFormat: @"%02ld : %02ld : %02ld", (long)hours, (long)minutes, (long)seconds]; + self.countdownLabel.text = displayText; +} + +- (IBAction)startCountdown:(id)sender { + if(!self.running) { + + self.running = YES; + + [sender setTitle:@"Pause" forState: UIControlStateNormal]; + + if (self.Remainder == -1) { + self.countDownInterval = (NSTimeInterval)_datePicker.countDownDuration; + self.Remainder = self.countDownInterval; + self.afterRemainder = self.countDownInterval - self.Remainder%60; + } + + countdownTimer = [NSTimer scheduledTimerWithTimeInterval:1 + target:self selector:@selector(updateTime) userInfo:nil repeats:YES]; + } else { + self.running = NO; + [sender setTitle:@"Start" forState: UIControlStateNormal]; + [countdownTimer invalidate]; + countdownTimer = nil; + } + +} + + + +//reset not restart +- (IBAction)restartButton:(id)sender { + self.running = NO; + [self.startButton setTitle:@"Start" forState:UIControlStateNormal]; + [countdownTimer invalidate]; + countdownTimer = nil; + self.countdownLabel.text = @"00.00.00"; + [self.startTimer invalidate]; + +} + +- (IBAction)presetButton:(id)sender { + +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + UINavigationController *navController = (UINavigationController *)[segue destinationViewController]; + + PresetTimerTableViewController *vc = (PresetTimerTableViewController *)[navController topViewController]; + + // vc.selectedPreset = self.presetInterval; + + +} + +@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/Wat.mp3 b/Time/Time/Wat.mp3 new file mode 100644 index 0000000..7462d0a Binary files /dev/null and b/Time/Time/Wat.mp3 differ diff --git a/Time/Time/WorldClockInfo.h b/Time/Time/WorldClockInfo.h new file mode 100644 index 0000000..c0bc14d --- /dev/null +++ b/Time/Time/WorldClockInfo.h @@ -0,0 +1,14 @@ +// +// WorldClockInfo.h +// Time +// +// Created by Chris David on 8/30/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface WorldClockInfo : NSObject +@property (nonatomic) NSString * cityName; +@property (nonatomic) NSString * cityTime; +@end diff --git a/Time/Time/WorldClockInfo.m b/Time/Time/WorldClockInfo.m new file mode 100644 index 0000000..0328227 --- /dev/null +++ b/Time/Time/WorldClockInfo.m @@ -0,0 +1,13 @@ +// +// WorldClockInfo.m +// Time +// +// Created by Chris David on 8/30/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "WorldClockInfo.h" + +@implementation WorldClockInfo + +@end diff --git a/Time/Time/WorldClockTableViewController.h b/Time/Time/WorldClockTableViewController.h new file mode 100644 index 0000000..a7ec0b8 --- /dev/null +++ b/Time/Time/WorldClockTableViewController.h @@ -0,0 +1,13 @@ +// +// WorldClockTableViewController.h +// Time +// +// Created by Chris David on 8/23/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface WorldClockTableViewController : UITableViewController + +@end diff --git a/Time/Time/WorldClockTableViewController.m b/Time/Time/WorldClockTableViewController.m new file mode 100644 index 0000000..9dcc99b --- /dev/null +++ b/Time/Time/WorldClockTableViewController.m @@ -0,0 +1,96 @@ +// +// WorldClockTableViewController.m +// Time +// +// Created by Chris David on 8/23/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "WorldClockTableViewController.h" +#import "WorldClockInfo.h" +#import "NewWorldClockTableViewController.h" + +@interface WorldClockTableViewController () +@property (nonatomic) NSMutableArray *selectedCitiesArray; +@end + +@implementation WorldClockTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + [self.navigationItem setTitle:@"World Clock"]; + + + self.selectedCitiesArray = [[NSMutableArray alloc] init]; + + //it changes the color only on second click + [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor redColor]}]; + + self.navigationItem.leftBarButtonItem = self.editButtonItem; +} + + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + + // Return the number of sections. + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + + // Return the number of rows in the section. + return self.selectedCitiesArray.count; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"worldClockIdentifier" forIndexPath:indexPath]; + + + WorldClockInfo *city = self.selectedCitiesArray[indexPath.row]; + cell.textLabel.text = city.cityName; + + cell.detailTextLabel.text = city.cityTime; + return cell; +} + + +//delegate method that allows for editing when the edit button is clicked + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + + [self.selectedCitiesArray removeObjectAtIndex:indexPath.row]; + + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; + + //entry removed from data source now reload + [self.tableView reloadData]; + + } +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + NewWorldClockTableViewController *vc = segue.destinationViewController; + + //NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + // CQCategory *newCategory = [self.allCategories objectAtIndex:indexPath.row]; + //vc.category = newCategory; + + vc.selectedCitiesArray = self.selectedCitiesArray; + +} + + +@end diff --git a/Time/Video.mp4 b/Time/Video.mp4 new file mode 100644 index 0000000..d8ef0a5 Binary files /dev/null and b/Time/Video.mp4 differ