diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..3169116 Binary files /dev/null and b/.DS_Store differ diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store new file mode 100644 index 0000000..b75977d 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 a2f82e3..5fe90d0 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 */; }; - 8DA86CD41BC1B8E4006C50BC /* ListsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */; }; - 8DA86CD71BC1B904006C50BC /* ListCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */; }; - 8DB2F6E71BC1E75500E58E65 /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DB2F6E01BC1E75500E58E65 /* List.m */; }; - 8DB2F6E81BC1E75500E58E65 /* List+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DB2F6E21BC1E75500E58E65 /* List+CoreDataProperties.m */; }; - 8DB2F6E91BC1E75500E58E65 /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DB2F6E41BC1E75500E58E65 /* Task.m */; }; - 8DB2F6EA1BC1E75500E58E65 /* Task+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DB2F6E61BC1E75500E58E65 /* Task+CoreDataProperties.m */; }; + D9E009681BC451B80080D110 /* TasksTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E009671BC451B80080D110 /* TasksTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + D9E0096B1BC4532B0080D110 /* TaskCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E0096A1BC4532B0080D110 /* TaskCreationTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + D9E564571BC1AE540001DD61 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E564561BC1AE540001DD61 /* main.m */; }; + D9E5645A1BC1AE540001DD61 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E564591BC1AE540001DD61 /* AppDelegate.m */; }; + D9E564601BC1AE540001DD61 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9E5645E1BC1AE540001DD61 /* Main.storyboard */; }; + D9E564631BC1AE540001DD61 /* MarsWater.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = D9E564611BC1AE540001DD61 /* MarsWater.xcdatamodeld */; }; + D9E564651BC1AE540001DD61 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D9E564641BC1AE540001DD61 /* Assets.xcassets */; }; + D9E564681BC1AE540001DD61 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9E564661BC1AE540001DD61 /* LaunchScreen.storyboard */; }; + D9E564771BC1B3780001DD61 /* Task+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E564701BC1B3780001DD61 /* Task+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; + D9E564781BC1B3780001DD61 /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E564721BC1B3780001DD61 /* Task.m */; settings = {ASSET_TAGS = (); }; }; + D9E564791BC1B3780001DD61 /* List+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E564741BC1B3780001DD61 /* List+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; + D9E5647A1BC1B3780001DD61 /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E564761BC1B3780001DD61 /* List.m */; settings = {ASSET_TAGS = (); }; }; + D9E5647E1BC1B9280001DD61 /* ListsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E5647D1BC1B9280001DD61 /* ListsTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + D9E564811BC1B9530001DD61 /* ListCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E564801BC1B9530001DD61 /* ListCreationTableViewController.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 = ""; }; - 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 = ""; }; - 8DB2F6DF1BC1E75500E58E65 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = ""; }; - 8DB2F6E01BC1E75500E58E65 /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = List.m; sourceTree = ""; }; - 8DB2F6E11BC1E75500E58E65 /* List+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "List+CoreDataProperties.h"; sourceTree = ""; }; - 8DB2F6E21BC1E75500E58E65 /* List+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "List+CoreDataProperties.m"; sourceTree = ""; }; - 8DB2F6E31BC1E75500E58E65 /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task.h; sourceTree = ""; }; - 8DB2F6E41BC1E75500E58E65 /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task.m; sourceTree = ""; }; - 8DB2F6E51BC1E75500E58E65 /* Task+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Task+CoreDataProperties.h"; sourceTree = ""; }; - 8DB2F6E61BC1E75500E58E65 /* Task+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Task+CoreDataProperties.m"; sourceTree = ""; }; + D9E009661BC451B80080D110 /* TasksTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TasksTableViewController.h; sourceTree = ""; }; + D9E009671BC451B80080D110 /* TasksTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TasksTableViewController.m; sourceTree = ""; }; + D9E009691BC4532B0080D110 /* TaskCreationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskCreationTableViewController.h; sourceTree = ""; }; + D9E0096A1BC4532B0080D110 /* TaskCreationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskCreationTableViewController.m; sourceTree = ""; }; + D9E564521BC1AE540001DD61 /* MarsWater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarsWater.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D9E564561BC1AE540001DD61 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + D9E564581BC1AE540001DD61 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + D9E564591BC1AE540001DD61 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + D9E5645F1BC1AE540001DD61 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D9E564621BC1AE540001DD61 /* MarsWater.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MarsWater.xcdatamodel; sourceTree = ""; }; + D9E564641BC1AE540001DD61 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D9E564671BC1AE540001DD61 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D9E564691BC1AE540001DD61 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D9E5646F1BC1B3780001DD61 /* Task+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Task+CoreDataProperties.h"; sourceTree = ""; }; + D9E564701BC1B3780001DD61 /* Task+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Task+CoreDataProperties.m"; sourceTree = ""; }; + D9E564711BC1B3780001DD61 /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task.h; sourceTree = ""; }; + D9E564721BC1B3780001DD61 /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task.m; sourceTree = ""; }; + D9E564731BC1B3780001DD61 /* List+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "List+CoreDataProperties.h"; sourceTree = ""; }; + D9E564741BC1B3780001DD61 /* List+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "List+CoreDataProperties.m"; sourceTree = ""; }; + D9E564751BC1B3780001DD61 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = ""; }; + D9E564761BC1B3780001DD61 /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = List.m; sourceTree = ""; }; + D9E5647C1BC1B9280001DD61 /* ListsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListsTableViewController.h; sourceTree = ""; }; + D9E5647D1BC1B9280001DD61 /* ListsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListsTableViewController.m; sourceTree = ""; }; + D9E5647F1BC1B9530001DD61 /* ListCreationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListCreationTableViewController.h; sourceTree = ""; }; + D9E564801BC1B9530001DD61 /* ListCreationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListCreationTableViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 8DA86CA11BC1AE57006C50BC /* Frameworks */ = { + D9E5644F1BC1AE540001DD61 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -56,61 +62,65 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 8DA86C9B1BC1AE57006C50BC = { + D9E564491BC1AE540001DD61 = { isa = PBXGroup; children = ( - 8DA86CA61BC1AE57006C50BC /* MarsWater */, - 8DA86CA51BC1AE57006C50BC /* Products */, + D9E564541BC1AE540001DD61 /* MarsWater */, + D9E564531BC1AE540001DD61 /* Products */, ); sourceTree = ""; }; - 8DA86CA51BC1AE57006C50BC /* Products */ = { + D9E564531BC1AE540001DD61 /* Products */ = { isa = PBXGroup; children = ( - 8DA86CA41BC1AE57006C50BC /* MarsWater.app */, + D9E564521BC1AE540001DD61 /* MarsWater.app */, ); name = Products; sourceTree = ""; }; - 8DA86CA61BC1AE57006C50BC /* MarsWater */ = { + D9E564541BC1AE540001DD61 /* 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 */, + D9E5647B1BC1B50B0001DD61 /* Model */, + D9E564581BC1AE540001DD61 /* AppDelegate.h */, + D9E564591BC1AE540001DD61 /* AppDelegate.m */, + D9E5647C1BC1B9280001DD61 /* ListsTableViewController.h */, + D9E5647D1BC1B9280001DD61 /* ListsTableViewController.m */, + D9E5647F1BC1B9530001DD61 /* ListCreationTableViewController.h */, + D9E564801BC1B9530001DD61 /* ListCreationTableViewController.m */, + D9E009661BC451B80080D110 /* TasksTableViewController.h */, + D9E009671BC451B80080D110 /* TasksTableViewController.m */, + D9E009691BC4532B0080D110 /* TaskCreationTableViewController.h */, + D9E0096A1BC4532B0080D110 /* TaskCreationTableViewController.m */, + D9E5645E1BC1AE540001DD61 /* Main.storyboard */, + D9E564641BC1AE540001DD61 /* Assets.xcassets */, + D9E564661BC1AE540001DD61 /* LaunchScreen.storyboard */, + D9E564691BC1AE540001DD61 /* Info.plist */, + D9E564611BC1AE540001DD61 /* MarsWater.xcdatamodeld */, + D9E564551BC1AE540001DD61 /* Supporting Files */, ); path = MarsWater; sourceTree = ""; }; - 8DA86CA71BC1AE57006C50BC /* Supporting Files */ = { + D9E564551BC1AE540001DD61 /* Supporting Files */ = { isa = PBXGroup; children = ( - 8DA86CA81BC1AE57006C50BC /* main.m */, + D9E564561BC1AE540001DD61 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; - 8DA86CD11BC1B329006C50BC /* Model */ = { + D9E5647B1BC1B50B0001DD61 /* Model */ = { isa = PBXGroup; children = ( - 8DB2F6DF1BC1E75500E58E65 /* List.h */, - 8DB2F6E01BC1E75500E58E65 /* List.m */, - 8DB2F6E11BC1E75500E58E65 /* List+CoreDataProperties.h */, - 8DB2F6E21BC1E75500E58E65 /* List+CoreDataProperties.m */, - 8DB2F6E31BC1E75500E58E65 /* Task.h */, - 8DB2F6E41BC1E75500E58E65 /* Task.m */, - 8DB2F6E51BC1E75500E58E65 /* Task+CoreDataProperties.h */, - 8DB2F6E61BC1E75500E58E65 /* Task+CoreDataProperties.m */, + D9E5646F1BC1B3780001DD61 /* Task+CoreDataProperties.h */, + D9E564701BC1B3780001DD61 /* Task+CoreDataProperties.m */, + D9E564711BC1B3780001DD61 /* Task.h */, + D9E564721BC1B3780001DD61 /* Task.m */, + D9E564731BC1B3780001DD61 /* List+CoreDataProperties.h */, + D9E564741BC1B3780001DD61 /* List+CoreDataProperties.m */, + D9E564751BC1B3780001DD61 /* List.h */, + D9E564761BC1B3780001DD61 /* List.m */, ); name = Model; sourceTree = ""; @@ -118,13 +128,13 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 8DA86CA31BC1AE57006C50BC /* MarsWater */ = { + D9E564511BC1AE540001DD61 /* MarsWater */ = { isa = PBXNativeTarget; - buildConfigurationList = 8DA86CBE1BC1AE57006C50BC /* Build configuration list for PBXNativeTarget "MarsWater" */; + buildConfigurationList = D9E5646C1BC1AE540001DD61 /* Build configuration list for PBXNativeTarget "MarsWater" */; buildPhases = ( - 8DA86CA01BC1AE57006C50BC /* Sources */, - 8DA86CA11BC1AE57006C50BC /* Frameworks */, - 8DA86CA21BC1AE57006C50BC /* Resources */, + D9E5644E1BC1AE540001DD61 /* Sources */, + D9E5644F1BC1AE540001DD61 /* Frameworks */, + D9E564501BC1AE540001DD61 /* Resources */, ); buildRules = ( ); @@ -132,24 +142,25 @@ ); name = MarsWater; productName = MarsWater; - productReference = 8DA86CA41BC1AE57006C50BC /* MarsWater.app */; + productReference = D9E564521BC1AE540001DD61 /* MarsWater.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 8DA86C9C1BC1AE57006C50BC /* Project object */ = { + D9E5644A1BC1AE540001DD61 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0700; - ORGANIZATIONNAME = "Michael Kavouras"; + ORGANIZATIONNAME = "Xiulan Shi"; TargetAttributes = { - 8DA86CA31BC1AE57006C50BC = { + D9E564511BC1AE540001DD61 = { CreatedOnToolsVersion = 7.0.1; + DevelopmentTeam = 85VFEKU7M5; }; }; }; - buildConfigurationList = 8DA86C9F1BC1AE57006C50BC /* Build configuration list for PBXProject "MarsWater" */; + buildConfigurationList = D9E5644D1BC1AE540001DD61 /* 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 = D9E564491BC1AE540001DD61; + productRefGroup = D9E564531BC1AE540001DD61 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 8DA86CA31BC1AE57006C50BC /* MarsWater */, + D9E564511BC1AE540001DD61 /* MarsWater */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 8DA86CA21BC1AE57006C50BC /* Resources */ = { + D9E564501BC1AE540001DD61 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8DA86CBA1BC1AE57006C50BC /* LaunchScreen.storyboard in Resources */, - 8DA86CB71BC1AE57006C50BC /* Assets.xcassets in Resources */, - 8DA86CB21BC1AE57006C50BC /* Main.storyboard in Resources */, + D9E564681BC1AE540001DD61 /* LaunchScreen.storyboard in Resources */, + D9E564651BC1AE540001DD61 /* Assets.xcassets in Resources */, + D9E564601BC1AE540001DD61 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 8DA86CA01BC1AE57006C50BC /* Sources */ = { + D9E5644E1BC1AE540001DD61 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8DA86CB51BC1AE57006C50BC /* MarsWater.xcdatamodeld in Sources */, - 8DA86CAC1BC1AE57006C50BC /* AppDelegate.m in Sources */, - 8DB2F6EA1BC1E75500E58E65 /* Task+CoreDataProperties.m in Sources */, - 8DA86CD41BC1B8E4006C50BC /* ListsTableViewController.m in Sources */, - 8DB2F6E71BC1E75500E58E65 /* List.m in Sources */, - 8DB2F6E91BC1E75500E58E65 /* Task.m in Sources */, - 8DA86CD71BC1B904006C50BC /* ListCreationTableViewController.m in Sources */, - 8DA86CA91BC1AE57006C50BC /* main.m in Sources */, - 8DB2F6E81BC1E75500E58E65 /* List+CoreDataProperties.m in Sources */, + D9E564631BC1AE540001DD61 /* MarsWater.xcdatamodeld in Sources */, + D9E564771BC1B3780001DD61 /* Task+CoreDataProperties.m in Sources */, + D9E0096B1BC4532B0080D110 /* TaskCreationTableViewController.m in Sources */, + D9E5645A1BC1AE540001DD61 /* AppDelegate.m in Sources */, + D9E5647E1BC1B9280001DD61 /* ListsTableViewController.m in Sources */, + D9E564781BC1B3780001DD61 /* Task.m in Sources */, + D9E5647A1BC1B3780001DD61 /* List.m in Sources */, + D9E009681BC451B80080D110 /* TasksTableViewController.m in Sources */, + D9E564811BC1B9530001DD61 /* ListCreationTableViewController.m in Sources */, + D9E564571BC1AE540001DD61 /* main.m in Sources */, + D9E564791BC1B3780001DD61 /* List+CoreDataProperties.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 8DA86CB01BC1AE57006C50BC /* Main.storyboard */ = { + D9E5645E1BC1AE540001DD61 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - 8DA86CB11BC1AE57006C50BC /* Base */, + D9E5645F1BC1AE540001DD61 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; - 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */ = { + D9E564661BC1AE540001DD61 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - 8DA86CB91BC1AE57006C50BC /* Base */, + D9E564671BC1AE540001DD61 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -219,7 +232,7 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 8DA86CBC1BC1AE57006C50BC /* Debug */ = { + D9E5646A1BC1AE540001DD61 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -262,7 +275,7 @@ }; name = Debug; }; - 8DA86CBD1BC1AE57006C50BC /* Release */ = { + D9E5646B1BC1AE540001DD61 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -299,24 +312,24 @@ }; name = Release; }; - 8DA86CBF1BC1AE57006C50BC /* Debug */ = { + D9E5646D1BC1AE540001DD61 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = MarsWater/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.MarsWater; + PRODUCT_BUNDLE_IDENTIFIER = nyc.c4q.xiulanshi.MarsWater; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; - 8DA86CC01BC1AE57006C50BC /* Release */ = { + D9E5646E1BC1AE540001DD61 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = MarsWater/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.MarsWater; + PRODUCT_BUNDLE_IDENTIFIER = nyc.c4q.xiulanshi.MarsWater; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -324,20 +337,20 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 8DA86C9F1BC1AE57006C50BC /* Build configuration list for PBXProject "MarsWater" */ = { + D9E5644D1BC1AE540001DD61 /* Build configuration list for PBXProject "MarsWater" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8DA86CBC1BC1AE57006C50BC /* Debug */, - 8DA86CBD1BC1AE57006C50BC /* Release */, + D9E5646A1BC1AE540001DD61 /* Debug */, + D9E5646B1BC1AE540001DD61 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8DA86CBE1BC1AE57006C50BC /* Build configuration list for PBXNativeTarget "MarsWater" */ = { + D9E5646C1BC1AE540001DD61 /* Build configuration list for PBXNativeTarget "MarsWater" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8DA86CBF1BC1AE57006C50BC /* Debug */, - 8DA86CC01BC1AE57006C50BC /* Release */, + D9E5646D1BC1AE540001DD61 /* Debug */, + D9E5646E1BC1AE540001DD61 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -345,17 +358,17 @@ /* End XCConfigurationList section */ /* Begin XCVersionGroup section */ - 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */ = { + D9E564611BC1AE540001DD61 /* MarsWater.xcdatamodeld */ = { isa = XCVersionGroup; children = ( - 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */, + D9E564621BC1AE540001DD61 /* MarsWater.xcdatamodel */, ); - currentVersion = 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */; + currentVersion = D9E564621BC1AE540001DD61 /* MarsWater.xcdatamodel */; path = MarsWater.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; }; /* End XCVersionGroup section */ }; - rootObject = 8DA86C9C1BC1AE57006C50BC /* Project object */; + rootObject = D9E5644A1BC1AE540001DD61 /* Project object */; } diff --git a/MarsWater/MarsWater/AppDelegate.h b/MarsWater/MarsWater/AppDelegate.h index 33642bf..6dbb8d5 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // #import diff --git a/MarsWater/MarsWater/AppDelegate.m b/MarsWater/MarsWater/AppDelegate.m index 8e592d7..f159047 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // #import "AppDelegate.h" @@ -51,7 +51,7 @@ - (void)applicationWillTerminate:(UIApplication *)application { @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. This code uses a directory named "nyc.c4q.xiulanshi.MarsWater" in the application's documents directory. return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; } diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard index 13ead89..74732af 100644 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -1,236 +1,374 @@ - + + - + - - + + - - + - - + + - - - - - - + + + - - + + - - + + + - + + - - - - - - - - - - - - - - - - - - + - + - + - - + + - - + - + - - + + - + - - - - - - - - + + + + + + - - - + + - + - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + - + - + - + - + diff --git a/MarsWater/MarsWater/List+CoreDataProperties.h b/MarsWater/MarsWater/List+CoreDataProperties.h index 9ce8d06..86c563a 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nullable, nonatomic, retain) NSString *title; @property (nullable, nonatomic, retain) NSDate *createdAt; @property (nullable, nonatomic, retain) id color; -@property (nullable, nonatomic, retain) NSArray *task; +@property (nullable, nonatomic, retain) NSOrderedSet *task; @end diff --git a/MarsWater/MarsWater/List+CoreDataProperties.m b/MarsWater/MarsWater/List+CoreDataProperties.m index 6c70870..b2ce5b4 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. 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..bc02c29 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. 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..33478d8 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // #import "List.h" +#import "Task.h" @implementation List diff --git a/MarsWater/MarsWater/ListCreationTableViewController.h b/MarsWater/MarsWater/ListCreationTableViewController.h index df226d4..0e318f0 100644 --- a/MarsWater/MarsWater/ListCreationTableViewController.h +++ b/MarsWater/MarsWater/ListCreationTableViewController.h @@ -2,8 +2,8 @@ // ListCreationTableViewController.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // #import diff --git a/MarsWater/MarsWater/ListCreationTableViewController.m b/MarsWater/MarsWater/ListCreationTableViewController.m index 0ecf6e9..5fa93a4 100644 --- a/MarsWater/MarsWater/ListCreationTableViewController.m +++ b/MarsWater/MarsWater/ListCreationTableViewController.m @@ -2,8 +2,8 @@ // ListCreationTableViewController.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // #import @@ -12,9 +12,7 @@ #import "AppDelegate.h" @interface ListCreationTableViewController () - @property (weak, nonatomic) IBOutlet UITextField *titleTextField; - @property (nonatomic) List *list; @end @@ -29,6 +27,7 @@ - (void)viewDidLoad { AppDelegate *delegate = [UIApplication sharedApplication].delegate; self.list = [NSEntityDescription insertNewObjectForEntityForName:@"List" inManagedObjectContext:delegate.managedObjectContext]; + } - (void)setupNavigationBar { @@ -38,8 +37,6 @@ - (void)setupNavigationBar { 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 } - (void)cancel { @@ -54,6 +51,7 @@ - (void)save { [delegate.managedObjectContext save:nil]; [self dismissViewControllerAnimated:YES completion:nil]; + } - (IBAction)colorButtonTapped:(UIButton *)sender { diff --git a/MarsWater/MarsWater/ListsTableViewController.h b/MarsWater/MarsWater/ListsTableViewController.h index e83a1d1..c595b0c 100644 --- a/MarsWater/MarsWater/ListsTableViewController.h +++ b/MarsWater/MarsWater/ListsTableViewController.h @@ -2,8 +2,8 @@ // ListsTableViewController.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // #import diff --git a/MarsWater/MarsWater/ListsTableViewController.m b/MarsWater/MarsWater/ListsTableViewController.m index 8a2659c..f8afe19 100644 --- a/MarsWater/MarsWater/ListsTableViewController.m +++ b/MarsWater/MarsWater/ListsTableViewController.m @@ -2,14 +2,15 @@ // ListsTableViewController.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // -#import #import "ListsTableViewController.h" +#import #import "AppDelegate.h" #import "List.h" +#import "TasksTableViewController.h" @interface ListsTableViewController () @@ -22,20 +23,14 @@ @implementation ListsTableViewController - (void)viewDidLoad { [super viewDidLoad]; - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - // 1) create an instance of NSFetchRequest with an entity name NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"List"]; - - // 2) create a sort descriptor NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; - // 3) set the sortDescriptors on the fetchRequest fetchRequest.sortDescriptors = @[sort]; - // 4) 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; @@ -43,34 +38,66 @@ - (void)viewDidLoad { [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]; + cell.backgroundColor = (UIColor *)list.color; return cell; } -- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { - + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (editingStyle == UITableViewCellEditingStyleDelete) { + + List *selectedList = self.fetchedResultsController.fetchedObjects[indexPath.row]; + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + [delegate.managedObjectContext deleteObject:selectedList]; + [delegate.managedObjectContext save:nil]; + } +} + +- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath{ + [self.tableView reloadData]; } -@end +#pragma mark - segue +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ + + if ([segue.identifier isEqualToString:@"showTask"]){ + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + TasksTableViewController *taskTVC = segue.destinationViewController; + + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + + taskTVC.list = list; + } + +} + +@end diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents index 116441d..8a9fe5d 100644 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -1,5 +1,5 @@ - + @@ -8,7 +8,7 @@ - + @@ -16,7 +16,7 @@ - - + + \ No newline at end of file diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.h b/MarsWater/MarsWater/Task+CoreDataProperties.h index 2cc11d7..647eff7 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. @@ -16,12 +16,12 @@ NS_ASSUME_NONNULL_BEGIN @interface Task (CoreDataProperties) @property (nullable, nonatomic, retain) NSString *taskDescription; -@property (nullable, nonatomic, retain) NSDate *createdAt; +@property (nullable, nonatomic, retain) NSDate *createAt; @property (nullable, nonatomic, retain) NSDate *dueAt; @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; @end diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.m b/MarsWater/MarsWater/Task+CoreDataProperties.m index 1ea972c..8da6078 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. @@ -14,7 +14,7 @@ @implementation Task (CoreDataProperties) @dynamic taskDescription; -@dynamic createdAt; +@dynamic createAt; @dynamic dueAt; @dynamic updatedAt; @dynamic priority; diff --git a/MarsWater/MarsWater/Task.h b/MarsWater/MarsWater/Task.h index e714efc..0284843 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. 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..21eb5ed 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // #import "Task.h" -#import "List.h" @implementation Task diff --git a/MarsWater/MarsWater/TaskCreationTableViewController.h b/MarsWater/MarsWater/TaskCreationTableViewController.h new file mode 100644 index 0000000..d135f89 --- /dev/null +++ b/MarsWater/MarsWater/TaskCreationTableViewController.h @@ -0,0 +1,16 @@ +// +// TaskCreationTableViewController.h +// MarsWater +// +// Created by Xiulan Shi on 10/6/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. +// + +#import +#import "List.h" + +@interface TaskCreationTableViewController : UITableViewController + +@property (nonatomic) List *list; + +@end diff --git a/MarsWater/MarsWater/TaskCreationTableViewController.m b/MarsWater/MarsWater/TaskCreationTableViewController.m new file mode 100644 index 0000000..98d7c81 --- /dev/null +++ b/MarsWater/MarsWater/TaskCreationTableViewController.m @@ -0,0 +1,72 @@ +// +// TaskCreationTableViewController.m +// MarsWater +// +// Created by Xiulan Shi on 10/6/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. +// + + +#import "TaskCreationTableViewController.h" +#import "Task.h" +#import "AppDelegate.h" + + +@interface TaskCreationTableViewController () + +@property (nonatomic) NSMutableOrderedSet *listTasks; + +@property (weak, nonatomic) IBOutlet UITextField *descriptionTextField; +@property (weak, nonatomic) IBOutlet UITextField *priorityTextField; +@property (weak, nonatomic) IBOutlet UIDatePicker *dueAtDatePicker; + +@property (nonatomic) Task *task; + +@end + +@implementation TaskCreationTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.listTasks = self.list.task.mutableCopy; + + [self setupNavigationBar]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; + +} + +- (void)setupNavigationBar { + + self.navigationItem.title = [NSString stringWithFormat:@"Add New Task to %@", self.list.title]; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; +} + +- (void)cancel { + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)save { + + self.task.taskDescription = self.descriptionTextField.text; + self.task.priority = [NSNumber numberWithInteger:[self.priorityTextField.text integerValue]]; + self.task.dueAt = self.dueAtDatePicker.date; + self.task.createAt = [NSDate date]; + self.task.list = self.list; + + [self.listTasks addObject:self.task]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + [delegate.managedObjectContext save:nil]; + + [self dismissViewControllerAnimated:YES completion:nil]; + +} + +@end diff --git a/MarsWater/MarsWater/TasksTableViewController.h b/MarsWater/MarsWater/TasksTableViewController.h new file mode 100644 index 0000000..d9b93db --- /dev/null +++ b/MarsWater/MarsWater/TasksTableViewController.h @@ -0,0 +1,16 @@ +// +// TasksTableViewController.h +// MarsWater +// +// Created by Xiulan Shi on 10/6/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. +// + +#import +#import "List.h" + +@interface TasksTableViewController : UITableViewController + +@property (nonatomic) List *list; + +@end diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m new file mode 100644 index 0000000..087e926 --- /dev/null +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -0,0 +1,95 @@ +// +// TasksTableViewController.m +// MarsWater +// +// Created by Xiulan Shi on 10/6/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. +// + +#import +#import "TasksTableViewController.h" +#import "TaskCreationTableViewController.h" +#import "AppDelegate.h" +#import "Task.h" + +@interface TasksTableViewController () + +@property (nonatomic) NSMutableOrderedSet *listTasks; + +@end + +@implementation TasksTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.navigationItem.title = self.list.title; + + [self.tableView reloadData]; + + self.tableView.backgroundColor = self.list.color; + self.tableView.backgroundView.backgroundColor = self.list.color; + +} + +- (void)viewWillAppear:(BOOL)animated{ + + [self.tableView reloadData]; +} + + +#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; + cell.backgroundColor = self.list.color; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:@"MM/dd/yyyy"]; + cell.detailTextLabel.text = [dateFormatter stringFromDate:task.dueAt]; + + return cell; +} + + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (editingStyle == UITableViewCellEditingStyleDelete) { + + Task *selectedTask = self.list.task[indexPath.row]; + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + [delegate.managedObjectContext deleteObject:selectedTask]; + [delegate.managedObjectContext save:nil]; + [self.tableView reloadData]; + } +} + + +#pragma mark - segue + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ + + UINavigationController *navController = segue.destinationViewController; + + TaskCreationTableViewController *taskCreationTVC = (TaskCreationTableViewController *)([navController viewControllers][0]); + + taskCreationTVC.list = self.list; +} + + + +@end \ No newline at end of file diff --git a/MarsWater/MarsWater/main.m b/MarsWater/MarsWater/main.m index c107d8b..0f7770c 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 Xiulan Shi on 10/4/15. +// Copyright © 2015 Xiulan Shi. All rights reserved. // #import