diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d8e4c2f..0000000 --- a/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 C4Q Access Code 2.2 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store new file mode 100644 index 0000000..6def41f Binary files /dev/null and b/MarsWater/.DS_Store differ diff --git a/MarsWater/MarsWater.xcodeproj/project.pbxproj b/MarsWater/MarsWater.xcodeproj/project.pbxproj index 61d423d..0fa5ee0 100644 --- a/MarsWater/MarsWater.xcodeproj/project.pbxproj +++ b/MarsWater/MarsWater.xcodeproj/project.pbxproj @@ -7,46 +7,52 @@ objects = { /* Begin PBXBuildFile section */ - 8DA86CA91BC1AE57006C50BC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CA81BC1AE57006C50BC /* main.m */; }; - 8DA86CAC1BC1AE57006C50BC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */; }; - 8DA86CB21BC1AE57006C50BC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB01BC1AE57006C50BC /* Main.storyboard */; }; - 8DA86CB51BC1AE57006C50BC /* MarsWater.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */; }; - 8DA86CB71BC1AE57006C50BC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */; }; - 8DA86CBA1BC1AE57006C50BC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */; }; - 8DA86CCD1BC1B31C006C50BC /* List+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CC61BC1B31C006C50BC /* List+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CCE1BC1B31C006C50BC /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CC81BC1B31C006C50BC /* List.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CCF1BC1B31C006C50BC /* Task+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CCA1BC1B31C006C50BC /* Task+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CD01BC1B31C006C50BC /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CCC1BC1B31C006C50BC /* Task.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CD41BC1B8E4006C50BC /* ListsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CD71BC1B904006C50BC /* ListCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 2957127E1BC5F7500090AEA6 /* TasksTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2957127D1BC5F7500090AEA6 /* TasksTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 295712811BC6A8C90090AEA6 /* CreateTaskTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 295712801BC6A8C90090AEA6 /* CreateTaskTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 6B80EDD91BC1AE4300283EB5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDD81BC1AE4300283EB5 /* main.m */; }; + 6B80EDDC1BC1AE4300283EB5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDDB1BC1AE4300283EB5 /* AppDelegate.m */; }; + 6B80EDE21BC1AE4300283EB5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B80EDE01BC1AE4300283EB5 /* Main.storyboard */; }; + 6B80EDE51BC1AE4300283EB5 /* MarsWater.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDE31BC1AE4300283EB5 /* MarsWater.xcdatamodeld */; }; + 6B80EDE71BC1AE4300283EB5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6B80EDE61BC1AE4300283EB5 /* Assets.xcassets */; }; + 6B80EDEA1BC1AE4300283EB5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B80EDE81BC1AE4300283EB5 /* LaunchScreen.storyboard */; }; + 6B80EDFD1BC1B32700283EB5 /* Task+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDF61BC1B32700283EB5 /* Task+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; + 6B80EDFE1BC1B32700283EB5 /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDF81BC1B32700283EB5 /* Task.m */; settings = {ASSET_TAGS = (); }; }; + 6B80EDFF1BC1B32700283EB5 /* List+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDFA1BC1B32700283EB5 /* List+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; + 6B80EE001BC1B32700283EB5 /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDFC1BC1B32700283EB5 /* List.m */; settings = {ASSET_TAGS = (); }; }; + 6B80EE031BC1B92300283EB5 /* ListsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EE021BC1B92300283EB5 /* ListsTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 6B80EE061BC1B93700283EB5 /* CreateListTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EE051BC1B93700283EB5 /* CreateListTableViewController.m */; settings = {ASSET_TAGS = (); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 8DA86CA41BC1AE57006C50BC /* MarsWater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarsWater.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 8DA86CA81BC1AE57006C50BC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 8DA86CAA1BC1AE57006C50BC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8DA86CB11BC1AE57006C50BC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MarsWater.xcdatamodel; sourceTree = ""; }; - 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 8DA86CB91BC1AE57006C50BC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 8DA86CBB1BC1AE57006C50BC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DA86CC51BC1B31C006C50BC /* List+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "List+CoreDataProperties.h"; path = "../List+CoreDataProperties.h"; sourceTree = ""; }; - 8DA86CC61BC1B31C006C50BC /* List+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "List+CoreDataProperties.m"; path = "../List+CoreDataProperties.m"; sourceTree = ""; }; - 8DA86CC71BC1B31C006C50BC /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = List.h; path = ../List.h; sourceTree = ""; }; - 8DA86CC81BC1B31C006C50BC /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = List.m; path = ../List.m; sourceTree = ""; }; - 8DA86CC91BC1B31C006C50BC /* Task+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Task+CoreDataProperties.h"; path = "../Task+CoreDataProperties.h"; sourceTree = ""; }; - 8DA86CCA1BC1B31C006C50BC /* Task+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "Task+CoreDataProperties.m"; path = "../Task+CoreDataProperties.m"; sourceTree = ""; }; - 8DA86CCB1BC1B31C006C50BC /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Task.h; path = ../Task.h; sourceTree = ""; }; - 8DA86CCC1BC1B31C006C50BC /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Task.m; path = ../Task.m; sourceTree = ""; }; - 8DA86CD21BC1B8E4006C50BC /* ListsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListsTableViewController.h; sourceTree = ""; }; - 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListsTableViewController.m; sourceTree = ""; }; - 8DA86CD51BC1B904006C50BC /* ListCreationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListCreationTableViewController.h; sourceTree = ""; }; - 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListCreationTableViewController.m; sourceTree = ""; }; + 2957127C1BC5F7500090AEA6 /* TasksTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TasksTableViewController.h; sourceTree = ""; }; + 2957127D1BC5F7500090AEA6 /* TasksTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TasksTableViewController.m; sourceTree = ""; }; + 2957127F1BC6A8C90090AEA6 /* CreateTaskTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateTaskTableViewController.h; sourceTree = ""; }; + 295712801BC6A8C90090AEA6 /* CreateTaskTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CreateTaskTableViewController.m; sourceTree = ""; }; + 6B80EDD41BC1AE4300283EB5 /* MarsWater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarsWater.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6B80EDD81BC1AE4300283EB5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 6B80EDDA1BC1AE4300283EB5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 6B80EDDB1BC1AE4300283EB5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 6B80EDE11BC1AE4300283EB5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6B80EDE41BC1AE4300283EB5 /* MarsWater.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MarsWater.xcdatamodel; sourceTree = ""; }; + 6B80EDE61BC1AE4300283EB5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6B80EDE91BC1AE4300283EB5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6B80EDEB1BC1AE4300283EB5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6B80EDF51BC1B32700283EB5 /* Task+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Task+CoreDataProperties.h"; sourceTree = ""; }; + 6B80EDF61BC1B32700283EB5 /* Task+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Task+CoreDataProperties.m"; sourceTree = ""; }; + 6B80EDF71BC1B32700283EB5 /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task.h; sourceTree = ""; }; + 6B80EDF81BC1B32700283EB5 /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task.m; sourceTree = ""; }; + 6B80EDF91BC1B32700283EB5 /* List+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "List+CoreDataProperties.h"; sourceTree = ""; }; + 6B80EDFA1BC1B32700283EB5 /* List+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "List+CoreDataProperties.m"; sourceTree = ""; }; + 6B80EDFB1BC1B32700283EB5 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = ""; }; + 6B80EDFC1BC1B32700283EB5 /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = List.m; sourceTree = ""; }; + 6B80EE011BC1B92300283EB5 /* ListsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListsTableViewController.h; sourceTree = ""; }; + 6B80EE021BC1B92300283EB5 /* ListsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListsTableViewController.m; sourceTree = ""; }; + 6B80EE041BC1B93700283EB5 /* CreateListTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateListTableViewController.h; sourceTree = ""; }; + 6B80EE051BC1B93700283EB5 /* CreateListTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CreateListTableViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 8DA86CA11BC1AE57006C50BC /* Frameworks */ = { + 6B80EDD11BC1AE4300283EB5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -56,61 +62,65 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 8DA86C9B1BC1AE57006C50BC = { + 6B80EDCB1BC1AE4300283EB5 = { isa = PBXGroup; children = ( - 8DA86CA61BC1AE57006C50BC /* MarsWater */, - 8DA86CA51BC1AE57006C50BC /* Products */, + 6B80EDD61BC1AE4300283EB5 /* MarsWater */, + 6B80EDD51BC1AE4300283EB5 /* Products */, ); sourceTree = ""; }; - 8DA86CA51BC1AE57006C50BC /* Products */ = { + 6B80EDD51BC1AE4300283EB5 /* Products */ = { isa = PBXGroup; children = ( - 8DA86CA41BC1AE57006C50BC /* MarsWater.app */, + 6B80EDD41BC1AE4300283EB5 /* MarsWater.app */, ); name = Products; sourceTree = ""; }; - 8DA86CA61BC1AE57006C50BC /* MarsWater */ = { + 6B80EDD61BC1AE4300283EB5 /* MarsWater */ = { isa = PBXGroup; children = ( - 8DA86CD11BC1B329006C50BC /* Model */, - 8DA86CAA1BC1AE57006C50BC /* AppDelegate.h */, - 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */, - 8DA86CD21BC1B8E4006C50BC /* ListsTableViewController.h */, - 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */, - 8DA86CD51BC1B904006C50BC /* ListCreationTableViewController.h */, - 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */, - 8DA86CB01BC1AE57006C50BC /* Main.storyboard */, - 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */, - 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */, - 8DA86CBB1BC1AE57006C50BC /* Info.plist */, - 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */, - 8DA86CA71BC1AE57006C50BC /* Supporting Files */, + 6B80EDF41BC1B2B600283EB5 /* Model */, + 6B80EDE01BC1AE4300283EB5 /* Main.storyboard */, + 6B80EDDA1BC1AE4300283EB5 /* AppDelegate.h */, + 6B80EDDB1BC1AE4300283EB5 /* AppDelegate.m */, + 6B80EE011BC1B92300283EB5 /* ListsTableViewController.h */, + 6B80EE021BC1B92300283EB5 /* ListsTableViewController.m */, + 6B80EE041BC1B93700283EB5 /* CreateListTableViewController.h */, + 6B80EE051BC1B93700283EB5 /* CreateListTableViewController.m */, + 2957127C1BC5F7500090AEA6 /* TasksTableViewController.h */, + 2957127D1BC5F7500090AEA6 /* TasksTableViewController.m */, + 2957127F1BC6A8C90090AEA6 /* CreateTaskTableViewController.h */, + 295712801BC6A8C90090AEA6 /* CreateTaskTableViewController.m */, + 6B80EDE61BC1AE4300283EB5 /* Assets.xcassets */, + 6B80EDE81BC1AE4300283EB5 /* LaunchScreen.storyboard */, + 6B80EDEB1BC1AE4300283EB5 /* Info.plist */, + 6B80EDE31BC1AE4300283EB5 /* MarsWater.xcdatamodeld */, + 6B80EDD71BC1AE4300283EB5 /* Supporting Files */, ); path = MarsWater; sourceTree = ""; }; - 8DA86CA71BC1AE57006C50BC /* Supporting Files */ = { + 6B80EDD71BC1AE4300283EB5 /* Supporting Files */ = { isa = PBXGroup; children = ( - 8DA86CA81BC1AE57006C50BC /* main.m */, + 6B80EDD81BC1AE4300283EB5 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; - 8DA86CD11BC1B329006C50BC /* Model */ = { + 6B80EDF41BC1B2B600283EB5 /* Model */ = { isa = PBXGroup; children = ( - 8DA86CC51BC1B31C006C50BC /* List+CoreDataProperties.h */, - 8DA86CC61BC1B31C006C50BC /* List+CoreDataProperties.m */, - 8DA86CC71BC1B31C006C50BC /* List.h */, - 8DA86CC81BC1B31C006C50BC /* List.m */, - 8DA86CC91BC1B31C006C50BC /* Task+CoreDataProperties.h */, - 8DA86CCA1BC1B31C006C50BC /* Task+CoreDataProperties.m */, - 8DA86CCB1BC1B31C006C50BC /* Task.h */, - 8DA86CCC1BC1B31C006C50BC /* Task.m */, + 6B80EDF91BC1B32700283EB5 /* List+CoreDataProperties.h */, + 6B80EDFA1BC1B32700283EB5 /* List+CoreDataProperties.m */, + 6B80EDFB1BC1B32700283EB5 /* List.h */, + 6B80EDFC1BC1B32700283EB5 /* List.m */, + 6B80EDF51BC1B32700283EB5 /* Task+CoreDataProperties.h */, + 6B80EDF61BC1B32700283EB5 /* Task+CoreDataProperties.m */, + 6B80EDF71BC1B32700283EB5 /* Task.h */, + 6B80EDF81BC1B32700283EB5 /* Task.m */, ); name = Model; sourceTree = ""; @@ -118,13 +128,13 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 8DA86CA31BC1AE57006C50BC /* MarsWater */ = { + 6B80EDD31BC1AE4300283EB5 /* MarsWater */ = { isa = PBXNativeTarget; - buildConfigurationList = 8DA86CBE1BC1AE57006C50BC /* Build configuration list for PBXNativeTarget "MarsWater" */; + buildConfigurationList = 6B80EDEE1BC1AE4300283EB5 /* Build configuration list for PBXNativeTarget "MarsWater" */; buildPhases = ( - 8DA86CA01BC1AE57006C50BC /* Sources */, - 8DA86CA11BC1AE57006C50BC /* Frameworks */, - 8DA86CA21BC1AE57006C50BC /* Resources */, + 6B80EDD01BC1AE4300283EB5 /* Sources */, + 6B80EDD11BC1AE4300283EB5 /* Frameworks */, + 6B80EDD21BC1AE4300283EB5 /* Resources */, ); buildRules = ( ); @@ -132,24 +142,25 @@ ); name = MarsWater; productName = MarsWater; - productReference = 8DA86CA41BC1AE57006C50BC /* MarsWater.app */; + productReference = 6B80EDD41BC1AE4300283EB5 /* MarsWater.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 8DA86C9C1BC1AE57006C50BC /* Project object */ = { + 6B80EDCC1BC1AE4300283EB5 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0700; - ORGANIZATIONNAME = "Michael Kavouras"; + ORGANIZATIONNAME = "Justine Gartner"; TargetAttributes = { - 8DA86CA31BC1AE57006C50BC = { - CreatedOnToolsVersion = 7.0.1; + 6B80EDD31BC1AE4300283EB5 = { + CreatedOnToolsVersion = 7.0; + DevelopmentTeam = N48NM3R37Q; }; }; }; - buildConfigurationList = 8DA86C9F1BC1AE57006C50BC /* Build configuration list for PBXProject "MarsWater" */; + buildConfigurationList = 6B80EDCF1BC1AE4300283EB5 /* Build configuration list for PBXProject "MarsWater" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -157,61 +168,63 @@ en, Base, ); - mainGroup = 8DA86C9B1BC1AE57006C50BC; - productRefGroup = 8DA86CA51BC1AE57006C50BC /* Products */; + mainGroup = 6B80EDCB1BC1AE4300283EB5; + productRefGroup = 6B80EDD51BC1AE4300283EB5 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 8DA86CA31BC1AE57006C50BC /* MarsWater */, + 6B80EDD31BC1AE4300283EB5 /* MarsWater */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 8DA86CA21BC1AE57006C50BC /* Resources */ = { + 6B80EDD21BC1AE4300283EB5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8DA86CBA1BC1AE57006C50BC /* LaunchScreen.storyboard in Resources */, - 8DA86CB71BC1AE57006C50BC /* Assets.xcassets in Resources */, - 8DA86CB21BC1AE57006C50BC /* Main.storyboard in Resources */, + 6B80EDEA1BC1AE4300283EB5 /* LaunchScreen.storyboard in Resources */, + 6B80EDE71BC1AE4300283EB5 /* Assets.xcassets in Resources */, + 6B80EDE21BC1AE4300283EB5 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 8DA86CA01BC1AE57006C50BC /* Sources */ = { + 6B80EDD01BC1AE4300283EB5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8DA86CB51BC1AE57006C50BC /* MarsWater.xcdatamodeld in Sources */, - 8DA86CCF1BC1B31C006C50BC /* Task+CoreDataProperties.m in Sources */, - 8DA86CAC1BC1AE57006C50BC /* AppDelegate.m in Sources */, - 8DA86CD41BC1B8E4006C50BC /* ListsTableViewController.m in Sources */, - 8DA86CD01BC1B31C006C50BC /* Task.m in Sources */, - 8DA86CCE1BC1B31C006C50BC /* List.m in Sources */, - 8DA86CD71BC1B904006C50BC /* ListCreationTableViewController.m in Sources */, - 8DA86CCD1BC1B31C006C50BC /* List+CoreDataProperties.m in Sources */, - 8DA86CA91BC1AE57006C50BC /* main.m in Sources */, + 295712811BC6A8C90090AEA6 /* CreateTaskTableViewController.m in Sources */, + 6B80EDE51BC1AE4300283EB5 /* MarsWater.xcdatamodeld in Sources */, + 6B80EDFD1BC1B32700283EB5 /* Task+CoreDataProperties.m in Sources */, + 6B80EDDC1BC1AE4300283EB5 /* AppDelegate.m in Sources */, + 6B80EDFE1BC1B32700283EB5 /* Task.m in Sources */, + 6B80EE001BC1B32700283EB5 /* List.m in Sources */, + 6B80EDD91BC1AE4300283EB5 /* main.m in Sources */, + 2957127E1BC5F7500090AEA6 /* TasksTableViewController.m in Sources */, + 6B80EE061BC1B93700283EB5 /* CreateListTableViewController.m in Sources */, + 6B80EDFF1BC1B32700283EB5 /* List+CoreDataProperties.m in Sources */, + 6B80EE031BC1B92300283EB5 /* ListsTableViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 8DA86CB01BC1AE57006C50BC /* Main.storyboard */ = { + 6B80EDE01BC1AE4300283EB5 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - 8DA86CB11BC1AE57006C50BC /* Base */, + 6B80EDE11BC1AE4300283EB5 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; - 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */ = { + 6B80EDE81BC1AE4300283EB5 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - 8DA86CB91BC1AE57006C50BC /* Base */, + 6B80EDE91BC1AE4300283EB5 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -219,7 +232,7 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 8DA86CBC1BC1AE57006C50BC /* Debug */ = { + 6B80EDEC1BC1AE4300283EB5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -262,7 +275,7 @@ }; name = Debug; }; - 8DA86CBD1BC1AE57006C50BC /* Release */ = { + 6B80EDED1BC1AE4300283EB5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -299,62 +312,69 @@ }; name = Release; }; - 8DA86CBF1BC1AE57006C50BC /* Debug */ = { + 6B80EDEF1BC1AE4300283EB5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = MarsWater/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.MarsWater; + PRODUCT_BUNDLE_IDENTIFIER = com.ayunavogel.MarsWater; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Debug; }; - 8DA86CC01BC1AE57006C50BC /* Release */ = { + 6B80EDF01BC1AE4300283EB5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = MarsWater/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.MarsWater; + PRODUCT_BUNDLE_IDENTIFIER = com.ayunavogel.MarsWater; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 8DA86C9F1BC1AE57006C50BC /* Build configuration list for PBXProject "MarsWater" */ = { + 6B80EDCF1BC1AE4300283EB5 /* Build configuration list for PBXProject "MarsWater" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8DA86CBC1BC1AE57006C50BC /* Debug */, - 8DA86CBD1BC1AE57006C50BC /* Release */, + 6B80EDEC1BC1AE4300283EB5 /* Debug */, + 6B80EDED1BC1AE4300283EB5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8DA86CBE1BC1AE57006C50BC /* Build configuration list for PBXNativeTarget "MarsWater" */ = { + 6B80EDEE1BC1AE4300283EB5 /* Build configuration list for PBXNativeTarget "MarsWater" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8DA86CBF1BC1AE57006C50BC /* Debug */, - 8DA86CC01BC1AE57006C50BC /* Release */, + 6B80EDEF1BC1AE4300283EB5 /* Debug */, + 6B80EDF01BC1AE4300283EB5 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ /* Begin XCVersionGroup section */ - 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */ = { + 6B80EDE31BC1AE4300283EB5 /* MarsWater.xcdatamodeld */ = { isa = XCVersionGroup; children = ( - 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */, + 6B80EDE41BC1AE4300283EB5 /* MarsWater.xcdatamodel */, ); - currentVersion = 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */; + currentVersion = 6B80EDE41BC1AE4300283EB5 /* MarsWater.xcdatamodel */; path = MarsWater.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; }; /* End XCVersionGroup section */ }; - rootObject = 8DA86C9C1BC1AE57006C50BC /* Project object */; + rootObject = 6B80EDCC1BC1AE4300283EB5 /* Project object */; } diff --git a/MarsWater/MarsWater/AppDelegate.h b/MarsWater/MarsWater/AppDelegate.h index 33642bf..7fe5645 100644 --- a/MarsWater/MarsWater/AppDelegate.h +++ b/MarsWater/MarsWater/AppDelegate.h @@ -2,8 +2,8 @@ // AppDelegate.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import diff --git a/MarsWater/MarsWater/AppDelegate.m b/MarsWater/MarsWater/AppDelegate.m index 8e592d7..63526ef 100644 --- a/MarsWater/MarsWater/AppDelegate.m +++ b/MarsWater/MarsWater/AppDelegate.m @@ -2,8 +2,8 @@ // AppDelegate.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import "AppDelegate.h" @@ -12,8 +12,10 @@ @interface AppDelegate () @end + @implementation AppDelegate +# pragma mark - AppDelegate methods - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. @@ -44,14 +46,16 @@ - (void)applicationWillTerminate:(UIApplication *)application { [self saveContext]; } + #pragma mark - Core Data stack @synthesize managedObjectContext = _managedObjectContext; @synthesize managedObjectModel = _managedObjectModel; @synthesize persistentStoreCoordinator = _persistentStoreCoordinator; + - (NSURL *)applicationDocumentsDirectory { - // The directory the application uses to store the Core Data store file. This code uses a directory named "com.mikekavouras.MarsWater" in the application's documents directory. + // The directory the application uses to store the Core Data store file (usually SQLite file). This code uses a directory named "nyc.c4q.justinekay.MarsWater" in the application's documents directory. return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; } @@ -75,9 +79,12 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MarsWater.sqlite"]; + NSError *error = nil; NSString *failureReason = @"There was an error creating or loading the application's saved data."; + if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { + // Report any error we got. NSMutableDictionary *dict = [NSMutableDictionary dictionary]; dict[NSLocalizedDescriptionKey] = @"Failed to initialize the application's saved data"; @@ -124,4 +131,5 @@ - (void)saveContext { } } + @end diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard index 13ead89..318217f 100644 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -1,236 +1,396 @@ - + - - + + - - + + - - + - + - - - + + + - - + + - - + + + - + + - + - + - - + + - - + + - - + - + - + - - + + - - + + - - + - + - + - - - - - - - - + + + + + + - - + - + - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - + + - + - + - + - + - + - - + + - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/MarsWater/MarsWater/CreateListTableViewController.h b/MarsWater/MarsWater/CreateListTableViewController.h new file mode 100644 index 0000000..bb204b0 --- /dev/null +++ b/MarsWater/MarsWater/CreateListTableViewController.h @@ -0,0 +1,13 @@ +// +// ListCreationTableViewController.h +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import + +@interface CreateListTableViewController : UITableViewController + +@end diff --git a/MarsWater/MarsWater/ListCreationTableViewController.m b/MarsWater/MarsWater/CreateListTableViewController.m similarity index 56% rename from MarsWater/MarsWater/ListCreationTableViewController.m rename to MarsWater/MarsWater/CreateListTableViewController.m index 0ecf6e9..23100c6 100644 --- a/MarsWater/MarsWater/ListCreationTableViewController.m +++ b/MarsWater/MarsWater/CreateListTableViewController.m @@ -2,62 +2,74 @@ // ListCreationTableViewController.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import -#import "ListCreationTableViewController.h" + +#import "CreateListTableViewController.h" #import "List.h" #import "AppDelegate.h" -@interface ListCreationTableViewController () +@interface CreateListTableViewController () @property (weak, nonatomic) IBOutlet UITextField *titleTextField; - -@property (nonatomic) List *list; +@property (nonatomic)List *list; @end -@implementation ListCreationTableViewController +@implementation CreateListTableViewController -- (void)viewDidLoad { +-(void)viewDidLoad{ [super viewDidLoad]; - [self setupNavigationBar]; AppDelegate *delegate = [UIApplication sharedApplication].delegate; - self.list = [NSEntityDescription insertNewObjectForEntityForName:@"List" inManagedObjectContext:delegate.managedObjectContext]; + + + [self setupNavigationBar]; } -- (void)setupNavigationBar { +-(void)setupNavigationBar{ - self.navigationItem.title = @"Create new list"; + self.navigationItem.title = @"Create New List"; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; - // set the right button to save + self.navigationItem.leftBarButtonItem.tintColor = [UIColor grayColor]; + self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:224.0/255.0 green:35.0/255.0 blue:70.0/255.0 alpha:1.0]; + } -- (void)cancel { +-(void)cancel{ + [self dismissViewControllerAnimated:YES completion:nil]; } -- (void)save { +- (IBAction)colorButtonTapped:(UIButton *)sender { + + self.list.color = sender.backgroundColor; + sender.alpha = 0.3; +} + +-(void)save{ + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + // set task's properties + self.list.title = self.titleTextField.text; self.list.createdAt = [NSDate date]; - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - [delegate.managedObjectContext save:nil]; + [delegate.managedObjectContext save:nil]; // saves task's properties to the core data context, incl. color method that is outside of this method, because appdelegate and entity were initiated in the viewDidLoad method [self dismissViewControllerAnimated:YES completion:nil]; + + NSLog(@"%@", self.list); } -- (IBAction)colorButtonTapped:(UIButton *)sender { - self.list.color = sender.backgroundColor; -} @end diff --git a/MarsWater/MarsWater/CreateTaskTableViewController.h b/MarsWater/MarsWater/CreateTaskTableViewController.h new file mode 100644 index 0000000..24d3b49 --- /dev/null +++ b/MarsWater/MarsWater/CreateTaskTableViewController.h @@ -0,0 +1,16 @@ +// +// CreateTaskTableViewController.h +// MarsWater +// +// Created by Ayuna Vogel on 10/8/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import +#import "List.h" + +@interface CreateTaskTableViewController : UITableViewController + +@property (nonatomic) List *list; + +@end diff --git a/MarsWater/MarsWater/CreateTaskTableViewController.m b/MarsWater/MarsWater/CreateTaskTableViewController.m new file mode 100644 index 0000000..3ee3b59 --- /dev/null +++ b/MarsWater/MarsWater/CreateTaskTableViewController.m @@ -0,0 +1,143 @@ +// +// CreateTaskTableViewController.m +// MarsWater +// +// Created by Ayuna Vogel on 10/8/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// +#import + +#import "CreateTaskTableViewController.h" +#import "AppDelegate.h" +#import "Task.h" + +@interface CreateTaskTableViewController () + +@property (weak, nonatomic) IBOutlet UITextField *titleTextField; + +@property (nonatomic) Task *task; + +@property (nonatomic) NSMutableOrderedSet *tasksInList; + + +@end + +@implementation CreateTaskTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; + + [self setupNavigationBar]; + + self.tasksInList = self.list.task.mutableCopy; + + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +-(void)setupNavigationBar{ + + self.navigationItem.title = @"Create New Task"; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; + + self.navigationItem.leftBarButtonItem.tintColor = [UIColor grayColor]; + self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:224.0/255.0 green:35.0/255.0 blue:70.0/255.0 alpha:1.0]; + +} + +-(void)cancel{ + + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (IBAction)colorButtonTapped:(UIButton *)sender { + + self.task.color = sender.backgroundColor; + sender.alpha = 0.3; +} + + +-(void)save{ + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.task.taskDescription = self.titleTextField.text; + + if (self.task.createdAt == nil) { + + self.task.createdAt = [NSDate date]; + + }else { + + self.task.updatedAt = [NSDate date]; + } + + + self.task.list = self.list; + + [delegate.managedObjectContext save:nil]; // nil = No Error, Save with no NSError parameter + + [self dismissViewControllerAnimated:YES completion:nil]; + + NSLog(@"%@", self.task); +} + + + + +/* +// 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; +} +*/ + +/* +#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/MarsWater/MarsWater/List+CoreDataProperties.h b/MarsWater/MarsWater/List+CoreDataProperties.h index 9ce8d06..cd8e39d 100644 --- a/MarsWater/MarsWater/List+CoreDataProperties.h +++ b/MarsWater/MarsWater/List+CoreDataProperties.h @@ -2,8 +2,8 @@ // List+CoreDataProperties.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. diff --git a/MarsWater/MarsWater/List+CoreDataProperties.m b/MarsWater/MarsWater/List+CoreDataProperties.m index 6c70870..6e9e7c8 100644 --- a/MarsWater/MarsWater/List+CoreDataProperties.m +++ b/MarsWater/MarsWater/List+CoreDataProperties.m @@ -2,8 +2,8 @@ // List+CoreDataProperties.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. diff --git a/MarsWater/MarsWater/List.h b/MarsWater/MarsWater/List.h index d7c69f2..cc84526 100644 --- a/MarsWater/MarsWater/List.h +++ b/MarsWater/MarsWater/List.h @@ -2,13 +2,15 @@ // List.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import #import +@class Task; + NS_ASSUME_NONNULL_BEGIN @interface List : NSManagedObject diff --git a/MarsWater/MarsWater/List.m b/MarsWater/MarsWater/List.m index 5edadfa..98eaa9c 100644 --- a/MarsWater/MarsWater/List.m +++ b/MarsWater/MarsWater/List.m @@ -2,11 +2,12 @@ // List.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import "List.h" +#import "Task.h" @implementation List diff --git a/MarsWater/MarsWater/ListCreationTableViewController.h b/MarsWater/MarsWater/ListCreationTableViewController.h deleted file mode 100644 index df226d4..0000000 --- a/MarsWater/MarsWater/ListCreationTableViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ListCreationTableViewController.h -// MarsWater -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import - -@interface ListCreationTableViewController : UITableViewController - -@end diff --git a/MarsWater/MarsWater/ListsTableViewController.h b/MarsWater/MarsWater/ListsTableViewController.h index e83a1d1..1a1918c 100644 --- a/MarsWater/MarsWater/ListsTableViewController.h +++ b/MarsWater/MarsWater/ListsTableViewController.h @@ -1,9 +1,9 @@ // -// ListsTableViewController.h +// ListTableViewController.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import diff --git a/MarsWater/MarsWater/ListsTableViewController.m b/MarsWater/MarsWater/ListsTableViewController.m index 8a2659c..676419a 100644 --- a/MarsWater/MarsWater/ListsTableViewController.m +++ b/MarsWater/MarsWater/ListsTableViewController.m @@ -1,76 +1,152 @@ // -// ListsTableViewController.m +// ListTableViewController.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import + #import "ListsTableViewController.h" #import "AppDelegate.h" #import "List.h" +#import "TasksTableViewController.h" -@interface ListsTableViewController () +@interface ListsTableViewController () @property (nonatomic) NSFetchedResultsController *fetchedResultsController; @end + @implementation ListsTableViewController - (void)viewDidLoad { [super viewDidLoad]; - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - // 1) create an instance of NSFetchRequest with an entity name + //Create an instance of NSFetchRequest with an entity name NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"List"]; - - // 2) create a sort descriptor + //create a sort descriptor NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; - // 3) set the sortDescriptors on the fetchRequest + //set the sort descriptors on the fetchRequest fetchRequest.sortDescriptors = @[sort]; - // 4) create a fetchedResultsController with a fetchRequest and a managedObjectContext, + //create a fetchedResultsController with a fetchRequest and a managedObjectContext self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; self.fetchedResultsController.delegate = self; [self.fetchedResultsController performFetch:nil]; - [self.tableView reloadData]; } - #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.fetchedResultsController.fetchedObjects.count; } + - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @"ListCellIdentifier" forIndexPath:indexPath]; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ListCellIdentifier" forIndexPath:indexPath]; List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; - cell.backgroundColor = (UIColor *)list.color; + cell.textLabel.text = list.title; - cell.detailTextLabel.text = [list.createdAt description]; + + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.dateStyle = NSDateFormatterShortStyle; + + cell.detailTextLabel.text = [formatter stringFromDate:list.createdAt]; + + if (!list.color) { + cell.backgroundColor = [UIColor whiteColor]; + } else { + cell.backgroundColor = (UIColor *)list.color; + } return cell; } -- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { - +-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ + + return YES; +} + +-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (editingStyle == UITableViewCellEditingStyleDelete) { + + List *selectedList = self.fetchedResultsController.fetchedObjects[indexPath.row]; + [self removeObjectFromCoreDataContext:selectedList]; + + } + +} + +#pragma mark - Core Data + +-(void)removeObjectFromCoreDataContext:(List *)selectedList { + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + NSManagedObjectContext *context = delegate.managedObjectContext; + [context deleteObject:selectedList]; + [context processPendingChanges]; + +} + + +// NSFetchResultsController delegate method +-(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath{ + [self.tableView reloadData]; } -@end +#pragma mark - Navigation + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if ([segue.identifier isEqualToString:@"TasksSegue"]){ + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + TasksTableViewController *tasksTVC = segue.destinationViewController; + + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + + tasksTVC.list = list; + + NSLog(@"taskTVC.list: %@", tasksTVC.list); + } + +} + + +/* +// 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; +} +*/ + +@end diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents index 116441d..b274f86 100644 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -1,5 +1,5 @@ - + @@ -7,16 +7,17 @@ + - + - - + + \ No newline at end of file diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.h b/MarsWater/MarsWater/Task+CoreDataProperties.h index 2cc11d7..b20fbc8 100644 --- a/MarsWater/MarsWater/Task+CoreDataProperties.h +++ b/MarsWater/MarsWater/Task+CoreDataProperties.h @@ -2,8 +2,8 @@ // Task+CoreDataProperties.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. @@ -17,11 +17,12 @@ NS_ASSUME_NONNULL_BEGIN @property (nullable, nonatomic, retain) NSString *taskDescription; @property (nullable, nonatomic, retain) NSDate *createdAt; -@property (nullable, nonatomic, retain) NSDate *dueAt; +@property (nullable, nonatomic, retain) NSDate *dueDate; @property (nullable, nonatomic, retain) NSDate *updatedAt; @property (nullable, nonatomic, retain) NSNumber *priority; @property (nullable, nonatomic, retain) NSDate *completedAt; -@property (nullable, nonatomic, retain) List *list; +@property (nullable, nonatomic, retain) NSManagedObject *list; +@property (nullable, nonatomic, retain) id color; @end diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.m b/MarsWater/MarsWater/Task+CoreDataProperties.m index 1ea972c..293b0bc 100644 --- a/MarsWater/MarsWater/Task+CoreDataProperties.m +++ b/MarsWater/MarsWater/Task+CoreDataProperties.m @@ -2,8 +2,8 @@ // Task+CoreDataProperties.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. @@ -15,10 +15,11 @@ @implementation Task (CoreDataProperties) @dynamic taskDescription; @dynamic createdAt; -@dynamic dueAt; +@dynamic dueDate; @dynamic updatedAt; @dynamic priority; @dynamic completedAt; @dynamic list; +@dynamic color; @end diff --git a/MarsWater/MarsWater/Task.h b/MarsWater/MarsWater/Task.h index e714efc..748cff5 100644 --- a/MarsWater/MarsWater/Task.h +++ b/MarsWater/MarsWater/Task.h @@ -2,15 +2,13 @@ // Task.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import #import -@class List; - NS_ASSUME_NONNULL_BEGIN @interface Task : NSManagedObject diff --git a/MarsWater/MarsWater/Task.m b/MarsWater/MarsWater/Task.m index c32ed42..e916539 100644 --- a/MarsWater/MarsWater/Task.m +++ b/MarsWater/MarsWater/Task.m @@ -2,12 +2,11 @@ // Task.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import "Task.h" -#import "List.h" @implementation Task diff --git a/MarsWater/MarsWater/TasksTableViewController.h b/MarsWater/MarsWater/TasksTableViewController.h new file mode 100644 index 0000000..92b1631 --- /dev/null +++ b/MarsWater/MarsWater/TasksTableViewController.h @@ -0,0 +1,17 @@ +// +// TasksTableViewController.h +// MarsWater +// +// Created by Ayuna Vogel on 10/7/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import +#import "List.h" + +@interface TasksTableViewController : UITableViewController + +@property (nonatomic) Task *task; +@property (nonatomic) List *list; + +@end diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m new file mode 100644 index 0000000..b76851f --- /dev/null +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -0,0 +1,169 @@ +// +// TasksTableViewController.m +// MarsWater +// +// Created by Ayuna Vogel on 10/7/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import "TasksTableViewController.h" +#import "AppDelegate.h" +#import "Task.h" +#import "CreateTaskTableViewController.h" + +@interface TasksTableViewController () + +@property (nonatomic) NSMutableOrderedSet *tasksList; + +@end + +@implementation TasksTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + //self.navigationItem.title = @"Tasks"; + self.navigationItem.title = self.list.title; + + [self.tableView reloadData]; + + self.tableView.backgroundColor = self.list.color; + self.tableView.backgroundView.backgroundColor = self.list.color; + + + +// AppDelegate *delegate = [UIApplication sharedApplication].delegate; +// +// //Create an instance of NSFetchRequest with an entity name +// NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Task"]; +// +// //create a sort descriptor +// NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; +// +// //set the sort descriptors on the fetchRequest +// fetchRequest.sortDescriptors = @[sort]; +// +// //create a fetchedResultsController with a fetchRequest and a managedObjectContext +// self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; +// +// self.fetchedResultsController.delegate = self; +// +// [self.fetchedResultsController performFetch:nil]; +// + + + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +-(void)viewDidAppear:(BOOL)animated{ + + [self.tableView reloadData]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.list.task.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TaskCellIdentifier" forIndexPath:indexPath]; + + Task *task = self.list.task[indexPath.row]; + + cell.textLabel.text = task.taskDescription; + self.tableView.backgroundColor = self.list.color; + if (!task.color) { + cell.backgroundColor = [UIColor whiteColor]; + } else { + cell.backgroundColor = task.color; + } + + return cell; + //Task *task = self.fetchedResultsController.fetchedObjects[indexPath.row]; + //cell.textLabel.text = task.taskDescription; + //cell.backgroundColor = (UIColor *)task.color; + + // NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + // formatter.dateStyle = NSDateFormatterShortStyle; + // cell.detailTextLabel.text = [formatter stringFromDate:task.createdAt]; +} + +// NSFetchResultsController delegate method +-(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath{ + + [self.tableView reloadData]; +} + +-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ + + return YES; +} + + +-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (editingStyle == UITableViewCellEditingStyleDelete) { + + Task *selectedTask = self.list.task[indexPath.row]; + [self removeObjectFromCoreDataContext:selectedTask]; + + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + + } + +} + + +#pragma mark - Core Data method + +-(void)removeObjectFromCoreDataContext:(Task *)selectedTask { + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + NSManagedObjectContext *context = delegate.managedObjectContext; + [context deleteObject:selectedTask]; + [context processPendingChanges]; + +} + + +#pragma mark - Navigation + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ + + UINavigationController *navController = segue.destinationViewController; + + CreateTaskTableViewController *createTaskTVC = (CreateTaskTableViewController *)([navController viewControllers][0]); + createTaskTVC.list = self.list; +} + + + +/* +// 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; +} +*/ + + +@end diff --git a/MarsWater/MarsWater/main.m b/MarsWater/MarsWater/main.m index c107d8b..5c2db3b 100644 --- a/MarsWater/MarsWater/main.m +++ b/MarsWater/MarsWater/main.m @@ -1,9 +1,9 @@ - +// // main.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import diff --git a/README.md b/README.md deleted file mode 100644 index 6cccc97..0000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Todo Core Data - -The project file for this weeks homework has some starter code. Specifically, there is an established `NSManagedObjectModel` (MarsWater.xcdatamodeld) and classes for each respective `Entity`. -The code in place successfully creates and saves `List` objects. - -The minimum requirement for your assignment is to create the functionality that supports creating `Task` objects, adding `Task` objects to a list, and saving the list. -You can determine the UX to make this happen, but it should be apparent that the tasks have been saved to the list. - -**Bonus options:** -* Allow users to edit a List/Task -* Allow users to delete a List/Task