diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..cc92c66 Binary files /dev/null and b/.DS_Store differ diff --git a/MarsWater.xcodeproj/project.pbxproj b/MarsWater.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1c6bd57 --- /dev/null +++ b/MarsWater.xcodeproj/project.pbxproj @@ -0,0 +1,373 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 4D53AEFC1BC441430084EFE8 /* TaskTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D53AEFB1BC441430084EFE8 /* TaskTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 4D87C4C81BC58B73003367F3 /* TaskCreateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D87C4C71BC58B73003367F3 /* TaskCreateViewController.m */; settings = {ASSET_TAGS = (); }; }; + 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 */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 4D53AEFA1BC441430084EFE8 /* TaskTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskTableViewController.h; sourceTree = ""; }; + 4D53AEFB1BC441430084EFE8 /* TaskTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskTableViewController.m; sourceTree = ""; }; + 4D87C4C61BC58B73003367F3 /* TaskCreateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskCreateViewController.h; sourceTree = ""; }; + 4D87C4C71BC58B73003367F3 /* TaskCreateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskCreateViewController.m; sourceTree = ""; }; + 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 = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8DA86CA11BC1AE57006C50BC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8DA86C9B1BC1AE57006C50BC = { + isa = PBXGroup; + children = ( + 8DA86CA61BC1AE57006C50BC /* MarsWater */, + 8DA86CA51BC1AE57006C50BC /* Products */, + ); + sourceTree = ""; + }; + 8DA86CA51BC1AE57006C50BC /* Products */ = { + isa = PBXGroup; + children = ( + 8DA86CA41BC1AE57006C50BC /* MarsWater.app */, + ); + name = Products; + sourceTree = ""; + }; + 8DA86CA61BC1AE57006C50BC /* MarsWater */ = { + isa = PBXGroup; + children = ( + 8DA86CD11BC1B329006C50BC /* Model */, + 8DA86CAA1BC1AE57006C50BC /* AppDelegate.h */, + 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */, + 8DA86CD21BC1B8E4006C50BC /* ListsTableViewController.h */, + 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */, + 8DA86CD51BC1B904006C50BC /* ListCreationTableViewController.h */, + 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */, + 4D53AEFA1BC441430084EFE8 /* TaskTableViewController.h */, + 4D53AEFB1BC441430084EFE8 /* TaskTableViewController.m */, + 4D87C4C61BC58B73003367F3 /* TaskCreateViewController.h */, + 4D87C4C71BC58B73003367F3 /* TaskCreateViewController.m */, + 8DA86CB01BC1AE57006C50BC /* Main.storyboard */, + 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */, + 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */, + 8DA86CBB1BC1AE57006C50BC /* Info.plist */, + 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */, + 8DA86CA71BC1AE57006C50BC /* Supporting Files */, + ); + path = MarsWater; + sourceTree = ""; + }; + 8DA86CA71BC1AE57006C50BC /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8DA86CA81BC1AE57006C50BC /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8DA86CD11BC1B329006C50BC /* 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 */, + ); + name = Model; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8DA86CA31BC1AE57006C50BC /* MarsWater */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8DA86CBE1BC1AE57006C50BC /* Build configuration list for PBXNativeTarget "MarsWater" */; + buildPhases = ( + 8DA86CA01BC1AE57006C50BC /* Sources */, + 8DA86CA11BC1AE57006C50BC /* Frameworks */, + 8DA86CA21BC1AE57006C50BC /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MarsWater; + productName = MarsWater; + productReference = 8DA86CA41BC1AE57006C50BC /* MarsWater.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8DA86C9C1BC1AE57006C50BC /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = "Michael Kavouras"; + TargetAttributes = { + 8DA86CA31BC1AE57006C50BC = { + CreatedOnToolsVersion = 7.0.1; + }; + }; + }; + buildConfigurationList = 8DA86C9F1BC1AE57006C50BC /* Build configuration list for PBXProject "MarsWater" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8DA86C9B1BC1AE57006C50BC; + productRefGroup = 8DA86CA51BC1AE57006C50BC /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8DA86CA31BC1AE57006C50BC /* MarsWater */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8DA86CA21BC1AE57006C50BC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DA86CBA1BC1AE57006C50BC /* LaunchScreen.storyboard in Resources */, + 8DA86CB71BC1AE57006C50BC /* Assets.xcassets in Resources */, + 8DA86CB21BC1AE57006C50BC /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8DA86CA01BC1AE57006C50BC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DA86CB51BC1AE57006C50BC /* MarsWater.xcdatamodeld in Sources */, + 8DA86CAC1BC1AE57006C50BC /* AppDelegate.m in Sources */, + 4D87C4C81BC58B73003367F3 /* TaskCreateViewController.m in Sources */, + 4D53AEFC1BC441430084EFE8 /* TaskTableViewController.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 */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 8DA86CB01BC1AE57006C50BC /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8DA86CB11BC1AE57006C50BC /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8DA86CB91BC1AE57006C50BC /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8DA86CBC1BC1AE57006C50BC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8DA86CBD1BC1AE57006C50BC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8DA86CBF1BC1AE57006C50BC /* 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_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 8DA86CC01BC1AE57006C50BC /* 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_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8DA86C9F1BC1AE57006C50BC /* Build configuration list for PBXProject "MarsWater" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8DA86CBC1BC1AE57006C50BC /* Debug */, + 8DA86CBD1BC1AE57006C50BC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8DA86CBE1BC1AE57006C50BC /* Build configuration list for PBXNativeTarget "MarsWater" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8DA86CBF1BC1AE57006C50BC /* Debug */, + 8DA86CC01BC1AE57006C50BC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */, + ); + currentVersion = 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */; + path = MarsWater.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 8DA86C9C1BC1AE57006C50BC /* Project object */; +} diff --git a/SavingForever/SavingForever.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 68% rename from SavingForever/SavingForever.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 43eb427..4acdfe2 100644 --- a/SavingForever/SavingForever.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:MarsWater.xcodeproj"> diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store new file mode 100644 index 0000000..44339e2 Binary files /dev/null and b/MarsWater/.DS_Store differ diff --git a/SavingForever/SavingForever/AppDelegate.h b/MarsWater/AppDelegate.h similarity index 97% rename from SavingForever/SavingForever/AppDelegate.h rename to MarsWater/AppDelegate.h index 6657831..33642bf 100644 --- a/SavingForever/SavingForever/AppDelegate.h +++ b/MarsWater/AppDelegate.h @@ -1,6 +1,6 @@ // // AppDelegate.h -// SavingForever +// MarsWater // // Created by Michael Kavouras on 10/4/15. // Copyright © 2015 Michael Kavouras. All rights reserved. diff --git a/SavingForever/SavingForever/AppDelegate.m b/MarsWater/AppDelegate.m similarity index 96% rename from SavingForever/SavingForever/AppDelegate.m rename to MarsWater/AppDelegate.m index 29b2305..8e592d7 100644 --- a/SavingForever/SavingForever/AppDelegate.m +++ b/MarsWater/AppDelegate.m @@ -1,6 +1,6 @@ // // AppDelegate.m -// SavingForever +// MarsWater // // Created by Michael Kavouras on 10/4/15. // Copyright © 2015 Michael Kavouras. All rights reserved. @@ -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.SavingForever" in the application's documents directory. + // 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. return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; } @@ -60,7 +60,7 @@ - (NSManagedObjectModel *)managedObjectModel { if (_managedObjectModel != nil) { return _managedObjectModel; } - NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"SavingForever" withExtension:@"momd"]; + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MarsWater" withExtension:@"momd"]; _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; return _managedObjectModel; } @@ -74,7 +74,7 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { // Create the coordinator and store _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; - NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"SavingForever.sqlite"]; + 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]) { diff --git a/SavingForever/SavingForever/Assets.xcassets/AppIcon.appiconset/Contents.json b/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from SavingForever/SavingForever/Assets.xcassets/AppIcon.appiconset/Contents.json rename to MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/SavingForever/SavingForever/Base.lproj/LaunchScreen.storyboard b/MarsWater/Base.lproj/LaunchScreen.storyboard similarity index 84% rename from SavingForever/SavingForever/Base.lproj/LaunchScreen.storyboard rename to MarsWater/Base.lproj/LaunchScreen.storyboard index 2e721e1..5a9c4a6 100644 --- a/SavingForever/SavingForever/Base.lproj/LaunchScreen.storyboard +++ b/MarsWater/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,7 @@ - + - + diff --git a/MarsWater/Base.lproj/Main.storyboard b/MarsWater/Base.lproj/Main.storyboard new file mode 100644 index 0000000..4ac6f18 --- /dev/null +++ b/MarsWater/Base.lproj/Main.storyboard @@ -0,0 +1,460 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SavingForever/SavingForever/Info.plist b/MarsWater/Info.plist similarity index 100% rename from SavingForever/SavingForever/Info.plist rename to MarsWater/Info.plist diff --git a/MarsWater/List+CoreDataProperties.h b/MarsWater/List+CoreDataProperties.h new file mode 100644 index 0000000..66670ff --- /dev/null +++ b/MarsWater/List+CoreDataProperties.h @@ -0,0 +1,25 @@ +// +// List+CoreDataProperties.h +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "List.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface List (CoreDataProperties) + +@property (nullable, nonatomic, retain) NSString *title; +@property (nullable, nonatomic, retain) NSDate *createdAt; +@property (nullable, nonatomic, retain) id color; +@property (nullable, nonatomic, retain) NSOrderedSet *task; // changed from NSArray + +@end + +NS_ASSUME_NONNULL_END diff --git a/MarsWater/List+CoreDataProperties.m b/MarsWater/List+CoreDataProperties.m new file mode 100644 index 0000000..6c70870 --- /dev/null +++ b/MarsWater/List+CoreDataProperties.m @@ -0,0 +1,21 @@ +// +// List+CoreDataProperties.m +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "List+CoreDataProperties.h" + +@implementation List (CoreDataProperties) + +@dynamic title; +@dynamic createdAt; +@dynamic color; +@dynamic task; + +@end diff --git a/MarsWater/List.h b/MarsWater/List.h new file mode 100644 index 0000000..d7c69f2 --- /dev/null +++ b/MarsWater/List.h @@ -0,0 +1,22 @@ +// +// List.h +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface List : NSManagedObject + +// Insert code here to declare functionality of your managed object subclass + +@end + +NS_ASSUME_NONNULL_END + +#import "List+CoreDataProperties.h" diff --git a/MarsWater/List.m b/MarsWater/List.m new file mode 100644 index 0000000..5edadfa --- /dev/null +++ b/MarsWater/List.m @@ -0,0 +1,15 @@ +// +// List.m +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import "List.h" + +@implementation List + +// Insert code here to add functionality to your managed object subclass + +@end diff --git a/MarsWater/ListCreationTableViewController.h b/MarsWater/ListCreationTableViewController.h new file mode 100644 index 0000000..df226d4 --- /dev/null +++ b/MarsWater/ListCreationTableViewController.h @@ -0,0 +1,13 @@ +// +// 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/ListCreationTableViewController.m b/MarsWater/ListCreationTableViewController.m new file mode 100644 index 0000000..ca5f51c --- /dev/null +++ b/MarsWater/ListCreationTableViewController.m @@ -0,0 +1,71 @@ +// +// ListCreationTableViewController.m +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import +#import "ListCreationTableViewController.h" +#import "List.h" +#import "AppDelegate.h" + +@interface ListCreationTableViewController () + +@property (weak, nonatomic) IBOutlet UITextField *titleTextField; +@property (nonatomic) List *list; +@property (nonatomic) id color; + +@end + +@implementation ListCreationTableViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self setupNavigationBar]; +} + +- (void)setupNavigationBar +{ + 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)]; +} + +- (void)cancel +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)save +{ + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + if (!self.list) { + self.list = [NSEntityDescription insertNewObjectForEntityForName:@"List" inManagedObjectContext:delegate.managedObjectContext]; + } + + self.list.title = self.titleTextField.text; + self.list.createdAt = [NSDate date]; + + if (!self.color) { + self.list.color = [UIColor whiteColor]; + } else { + self.list.color = self.color; + } + + [delegate.managedObjectContext save:nil]; + + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (IBAction)colorButtonTapped:(UIButton *)sender +{ + self.color = sender.backgroundColor; +} + +@end diff --git a/SavingForever/SavingForever/ViewController.h b/MarsWater/ListsTableViewController.h similarity index 58% rename from SavingForever/SavingForever/ViewController.h rename to MarsWater/ListsTableViewController.h index b193f94..e83a1d1 100644 --- a/SavingForever/SavingForever/ViewController.h +++ b/MarsWater/ListsTableViewController.h @@ -1,6 +1,6 @@ // -// ViewController.h -// SavingForever +// ListsTableViewController.h +// MarsWater // // Created by Michael Kavouras on 10/4/15. // Copyright © 2015 Michael Kavouras. All rights reserved. @@ -8,8 +8,6 @@ #import -@interface ViewController : UIViewController - +@interface ListsTableViewController : UITableViewController @end - diff --git a/MarsWater/ListsTableViewController.m b/MarsWater/ListsTableViewController.m new file mode 100644 index 0000000..c41edbf --- /dev/null +++ b/MarsWater/ListsTableViewController.m @@ -0,0 +1,132 @@ +// +// ListsTableViewController.m +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import +#import "ListsTableViewController.h" +#import "AppDelegate.h" +#import "List.h" +#import "TaskTableViewController.h" + +@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 + 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; + + [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]; + + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + cell.backgroundColor = (UIColor *)list.color; + cell.textLabel.text = list.title; + cell.detailTextLabel.text = [list.createdAt description]; + + return cell; +} + +- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller +{ + [self.tableView beginUpdates]; +} + +- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath +{ + + UITableView *tableView = self.tableView; + + switch (type) { + case NSFetchedResultsChangeDelete: + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] + withRowAnimation:UITableViewRowAnimationFade]; + break; + + case NSFetchedResultsChangeInsert: + [self.tableView insertRowsAtIndexPaths:@[newIndexPath] + withRowAnimation:UITableViewRowAnimationFade]; + break; + + default: + break; + } +} + +- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller +{ + [self.tableView endUpdates]; +} + +#pragma mark - prepareForSegue + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + if ([[segue identifier] isEqualToString:@"showListName"]) { // create reference to segue title + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; // for the selected row + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; // grab dictionary of stored items + TaskTableViewController *detailController = segue.destinationViewController; // set destination viewController + + NSLog(@"%@", list); + + detailController.list = list; // pass list name for navigation bar title + } +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) { // delete rows + + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; // grab dictionary of stored items + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + [delegate.managedObjectContext deleteObject:list]; + [delegate.managedObjectContext save:nil]; + } +} + +@end + diff --git a/SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion b/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion similarity index 83% rename from SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion rename to MarsWater/MarsWater.xcdatamodeld/.xccurrentversion index 352ed15..5c0cbd5 100644 --- a/SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion +++ b/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - SavingForever.xcdatamodel + MarsWater.xcdatamodel diff --git a/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents new file mode 100644 index 0000000..116441d --- /dev/null +++ b/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MarsWater/Task+CoreDataProperties.h b/MarsWater/Task+CoreDataProperties.h new file mode 100644 index 0000000..859c701 --- /dev/null +++ b/MarsWater/Task+CoreDataProperties.h @@ -0,0 +1,30 @@ +// +// Task+CoreDataProperties.h +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "Task.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface Task (CoreDataProperties) + +@property (nullable, nonatomic, retain) NSString *taskDescription; +@property (nullable, nonatomic, retain) NSDate *createdAt; +@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 (nonatomic, readonly, getter=isEmpty) BOOL empty; + +@end + +NS_ASSUME_NONNULL_END diff --git a/MarsWater/Task+CoreDataProperties.m b/MarsWater/Task+CoreDataProperties.m new file mode 100644 index 0000000..5d11482 --- /dev/null +++ b/MarsWater/Task+CoreDataProperties.m @@ -0,0 +1,29 @@ +// +// Task+CoreDataProperties.m +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "Task+CoreDataProperties.h" + +@implementation Task (CoreDataProperties) + +@dynamic taskDescription; +@dynamic createdAt; +@dynamic dueAt; +@dynamic updatedAt; +@dynamic priority; +@dynamic completedAt; +@dynamic list; + +//- (BOOL)isEmpty +//{ +// return [self.taskDescription stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length == 0; +//} + +@end diff --git a/MarsWater/Task.h b/MarsWater/Task.h new file mode 100644 index 0000000..e714efc --- /dev/null +++ b/MarsWater/Task.h @@ -0,0 +1,24 @@ +// +// Task.h +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import +#import + +@class List; + +NS_ASSUME_NONNULL_BEGIN + +@interface Task : NSManagedObject + +// Insert code here to declare functionality of your managed object subclass + +@end + +NS_ASSUME_NONNULL_END + +#import "Task+CoreDataProperties.h" diff --git a/MarsWater/Task.m b/MarsWater/Task.m new file mode 100644 index 0000000..c32ed42 --- /dev/null +++ b/MarsWater/Task.m @@ -0,0 +1,16 @@ +// +// Task.m +// MarsWater +// +// Created by Michael Kavouras on 10/4/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import "Task.h" +#import "List.h" + +@implementation Task + +// Insert code here to add functionality to your managed object subclass + +@end diff --git a/MarsWater/TaskCreateViewController.h b/MarsWater/TaskCreateViewController.h new file mode 100644 index 0000000..0549f1d --- /dev/null +++ b/MarsWater/TaskCreateViewController.h @@ -0,0 +1,17 @@ +// +// TaskCreateViewController.h +// MarsWater +// +// Created by Shena Yoshida on 10/7/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import + +@class List; // let this view controller know that List is a valid class + +@interface TaskCreateViewController : UIViewController + +@property (nonatomic) List *list; + +@end diff --git a/MarsWater/TaskCreateViewController.m b/MarsWater/TaskCreateViewController.m new file mode 100644 index 0000000..2a61569 --- /dev/null +++ b/MarsWater/TaskCreateViewController.m @@ -0,0 +1,82 @@ +// +// TaskCreateViewController.m +// MarsWater +// +// Created by Shena Yoshida on 10/7/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import "TaskCreateViewController.h" +#import +#import "Task.h" +#import "AppDelegate.h" // to access the cool built in core data methods +#import "List.h" + +@interface TaskCreateViewController () + +@property (nonatomic) Task *task; +@property (weak, nonatomic) IBOutlet UITextField *taskTextField; +@property (weak, nonatomic) IBOutlet UISlider *prioritySlider; +@property (nonatomic) NSNumber *priorityNumber; + +@end + +@implementation TaskCreateViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self setupNavigationBar]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; +} + +- (void)setupNavigationBar +{ + // set the title + self.navigationItem.title = @"Create To Do Item"; + + // set the left button to cancel + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + + // set the right button to save + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; + + // NSLog(@"%@", self.taskTextField.text); // test it! +} + +- (void)cancel +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (IBAction)sliderValueChanged:(id)sender +{ + self.priorityNumber = [[NSNumber alloc]initWithFloat:self.prioritySlider.value]; // set slider value to storage number +} + +- (void)save +{ + if (self.taskTextField.text.length != 0) { // if there is text to save + + self.task.taskDescription = self.taskTextField.text; + self.task.createdAt = [NSDate date]; + self.task.priority = self.priorityNumber; + self.task.list = self.list; + + // self.task.dueAt = + // self.task.completedAt = + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; // set delegate + + [delegate.managedObjectContext save:nil]; + + [self dismissViewControllerAnimated:YES completion:nil]; // dismiss viewController and return to TaskTableView + } + + NSLog(@"task: %@, created at: %@, priority: %@", self.task.taskDescription, self.task.createdAt, self.task.priority); // test it! +} + +@end diff --git a/MarsWater/TaskTableViewController.h b/MarsWater/TaskTableViewController.h new file mode 100644 index 0000000..d8abd91 --- /dev/null +++ b/MarsWater/TaskTableViewController.h @@ -0,0 +1,20 @@ +// +// TaskTableViewController.h +// MarsWater +// +// Created by Shena Yoshida on 10/6/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import +#import "Task.h" +#import "ListsTableViewController.h" +#import "AppDelegate.h" +#import "List.h" + +@interface TaskTableViewController : UITableViewController + +@property (nonatomic) Task *task; +@property (nonatomic) List *list; + +@end diff --git a/MarsWater/TaskTableViewController.m b/MarsWater/TaskTableViewController.m new file mode 100644 index 0000000..f17a4f3 --- /dev/null +++ b/MarsWater/TaskTableViewController.m @@ -0,0 +1,107 @@ +// +// TaskTableViewController.m +// MarsWater +// +// Created by Shena Yoshida on 10/6/15. +// Copyright © 2015 Michael Kavouras. All rights reserved. +// + +#import "TaskTableViewController.h" +#import +#import "TaskCreateViewController.h" + +@interface TaskTableViewController () + +@property (nonatomic) NSFetchedResultsController *fetchedResultsController; + +@end + +@implementation TaskTableViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self setupNavigationBar]; + [self fetchResults]; +} + +-(void)setupNavigationBar +{ + self.navigationItem.title = self.list.title; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(createNewItem)]; +} + +- (void)cancel +{ + [self.navigationController popToRootViewControllerAnimated:YES]; +} + +- (void)createNewItem +{ + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; + + TaskCreateViewController *createVC = [storyboard instantiateViewControllerWithIdentifier:@"TaskCreateIdentifier"]; + createVC.list = self.list; + + // Here's another way to add a UINavigationController: + // UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"NavigationItem"]; + + UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:createVC]; + + [self presentViewController:navigationController animated:YES completion:nil]; +} + +- (void)fetchResults +{ + AppDelegate *delegate = [UIApplication sharedApplication].delegate; // set delegate + + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Task"]; // create fetch request instance for tasks + + NSSortDescriptor *sort = [[NSSortDescriptor alloc]initWithKey:@"priority" ascending:NO]; //create sort descriptor, sort by priority + + fetchRequest.sortDescriptors = @[sort]; // have fetched items organized by sort descriptor + + fetchRequest.predicate = [NSPredicate predicateWithFormat:@"list.title == %@", self.list.title]; // set task predicate to individual list + + self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; // create fetch request controller and set to our fetchRequest (tasks) + + self.fetchedResultsController.delegate = self; // set delegate for fetchRequestController + + [self.fetchedResultsController performFetch:nil]; // perform fetch + + [self.tableView reloadData]; // reload table view +} + + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return self.fetchedResultsController.fetchedObjects.count; // number of fetched items in memory +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"taskCellIdentifier" forIndexPath:indexPath]; + + Task *task = self.fetchedResultsController.fetchedObjects[indexPath.row]; + cell.textLabel.text = task.taskDescription; + + return cell; +} + +- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath // this method reloads table after item is added +{ + [self.tableView reloadData]; +} + +@end diff --git a/SavingForever/SavingForever/main.m b/MarsWater/main.m similarity index 94% rename from SavingForever/SavingForever/main.m rename to MarsWater/main.m index 0d1314d..c107d8b 100644 --- a/SavingForever/SavingForever/main.m +++ b/MarsWater/main.m @@ -1,6 +1,6 @@ -// + // main.m -// SavingForever +// MarsWater // // Created by Michael Kavouras on 10/4/15. // Copyright © 2015 Michael Kavouras. All rights reserved. diff --git a/SavingForever/SavingForever.xcodeproj/project.pbxproj b/SavingForever/SavingForever.xcodeproj/project.pbxproj deleted file mode 100644 index cbf89e2..0000000 --- a/SavingForever/SavingForever.xcodeproj/project.pbxproj +++ /dev/null @@ -1,322 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 8D2949671BC1D06E00FDC81F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D2949661BC1D06E00FDC81F /* main.m */; }; - 8D29496A1BC1D06E00FDC81F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D2949691BC1D06E00FDC81F /* AppDelegate.m */; }; - 8D29496D1BC1D06E00FDC81F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D29496C1BC1D06E00FDC81F /* ViewController.m */; }; - 8D2949701BC1D06E00FDC81F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8D29496E1BC1D06E00FDC81F /* Main.storyboard */; }; - 8D2949731BC1D06E00FDC81F /* SavingForever.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 8D2949711BC1D06E00FDC81F /* SavingForever.xcdatamodeld */; }; - 8D2949751BC1D06E00FDC81F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8D2949741BC1D06E00FDC81F /* Assets.xcassets */; }; - 8D2949781BC1D06E00FDC81F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8D2949761BC1D06E00FDC81F /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 8D2949621BC1D06E00FDC81F /* SavingForever.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SavingForever.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D2949661BC1D06E00FDC81F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 8D2949681BC1D06E00FDC81F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 8D2949691BC1D06E00FDC81F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8D29496B1BC1D06E00FDC81F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 8D29496C1BC1D06E00FDC81F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 8D29496F1BC1D06E00FDC81F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 8D2949721BC1D06E00FDC81F /* SavingForever.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SavingForever.xcdatamodel; sourceTree = ""; }; - 8D2949741BC1D06E00FDC81F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 8D2949771BC1D06E00FDC81F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 8D2949791BC1D06E00FDC81F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D29495F1BC1D06E00FDC81F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 8D2949591BC1D06D00FDC81F = { - isa = PBXGroup; - children = ( - 8D2949641BC1D06E00FDC81F /* SavingForever */, - 8D2949631BC1D06E00FDC81F /* Products */, - ); - sourceTree = ""; - }; - 8D2949631BC1D06E00FDC81F /* Products */ = { - isa = PBXGroup; - children = ( - 8D2949621BC1D06E00FDC81F /* SavingForever.app */, - ); - name = Products; - sourceTree = ""; - }; - 8D2949641BC1D06E00FDC81F /* SavingForever */ = { - isa = PBXGroup; - children = ( - 8D2949681BC1D06E00FDC81F /* AppDelegate.h */, - 8D2949691BC1D06E00FDC81F /* AppDelegate.m */, - 8D29496B1BC1D06E00FDC81F /* ViewController.h */, - 8D29496C1BC1D06E00FDC81F /* ViewController.m */, - 8D29496E1BC1D06E00FDC81F /* Main.storyboard */, - 8D2949741BC1D06E00FDC81F /* Assets.xcassets */, - 8D2949761BC1D06E00FDC81F /* LaunchScreen.storyboard */, - 8D2949791BC1D06E00FDC81F /* Info.plist */, - 8D2949711BC1D06E00FDC81F /* SavingForever.xcdatamodeld */, - 8D2949651BC1D06E00FDC81F /* Supporting Files */, - ); - path = SavingForever; - sourceTree = ""; - }; - 8D2949651BC1D06E00FDC81F /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 8D2949661BC1D06E00FDC81F /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D2949611BC1D06E00FDC81F /* SavingForever */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8D29497C1BC1D06E00FDC81F /* Build configuration list for PBXNativeTarget "SavingForever" */; - buildPhases = ( - 8D29495E1BC1D06E00FDC81F /* Sources */, - 8D29495F1BC1D06E00FDC81F /* Frameworks */, - 8D2949601BC1D06E00FDC81F /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SavingForever; - productName = SavingForever; - productReference = 8D2949621BC1D06E00FDC81F /* SavingForever.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 8D29495A1BC1D06D00FDC81F /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = "Michael Kavouras"; - TargetAttributes = { - 8D2949611BC1D06E00FDC81F = { - CreatedOnToolsVersion = 7.0.1; - }; - }; - }; - buildConfigurationList = 8D29495D1BC1D06D00FDC81F /* Build configuration list for PBXProject "SavingForever" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 8D2949591BC1D06D00FDC81F; - productRefGroup = 8D2949631BC1D06E00FDC81F /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D2949611BC1D06E00FDC81F /* SavingForever */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D2949601BC1D06E00FDC81F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D2949781BC1D06E00FDC81F /* LaunchScreen.storyboard in Resources */, - 8D2949751BC1D06E00FDC81F /* Assets.xcassets in Resources */, - 8D2949701BC1D06E00FDC81F /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D29495E1BC1D06E00FDC81F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D29496D1BC1D06E00FDC81F /* ViewController.m in Sources */, - 8D29496A1BC1D06E00FDC81F /* AppDelegate.m in Sources */, - 8D2949671BC1D06E00FDC81F /* main.m in Sources */, - 8D2949731BC1D06E00FDC81F /* SavingForever.xcdatamodeld in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 8D29496E1BC1D06E00FDC81F /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8D29496F1BC1D06E00FDC81F /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 8D2949761BC1D06E00FDC81F /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8D2949771BC1D06E00FDC81F /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 8D29497A1BC1D06E00FDC81F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 8D29497B1BC1D06E00FDC81F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 8D29497D1BC1D06E00FDC81F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SavingForever/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.SavingForever; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 8D29497E1BC1D06E00FDC81F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SavingForever/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.SavingForever; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 8D29495D1BC1D06D00FDC81F /* Build configuration list for PBXProject "SavingForever" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8D29497A1BC1D06E00FDC81F /* Debug */, - 8D29497B1BC1D06E00FDC81F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 8D29497C1BC1D06E00FDC81F /* Build configuration list for PBXNativeTarget "SavingForever" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8D29497D1BC1D06E00FDC81F /* Debug */, - 8D29497E1BC1D06E00FDC81F /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - -/* Begin XCVersionGroup section */ - 8D2949711BC1D06E00FDC81F /* SavingForever.xcdatamodeld */ = { - isa = XCVersionGroup; - children = ( - 8D2949721BC1D06E00FDC81F /* SavingForever.xcdatamodel */, - ); - currentVersion = 8D2949721BC1D06E00FDC81F /* SavingForever.xcdatamodel */; - path = SavingForever.xcdatamodeld; - sourceTree = ""; - versionGroupType = wrapper.xcdatamodel; - }; -/* End XCVersionGroup section */ - }; - rootObject = 8D29495A1BC1D06D00FDC81F /* Project object */; -} diff --git a/SavingForever/SavingForever/Base.lproj/Main.storyboard b/SavingForever/SavingForever/Base.lproj/Main.storyboard deleted file mode 100644 index f56d2f3..0000000 --- a/SavingForever/SavingForever/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SavingForever/SavingForever/SavingForever.xcdatamodeld/SavingForever.xcdatamodel/contents b/SavingForever/SavingForever/SavingForever.xcdatamodeld/SavingForever.xcdatamodel/contents deleted file mode 100644 index 193f33c..0000000 --- a/SavingForever/SavingForever/SavingForever.xcdatamodeld/SavingForever.xcdatamodel/contents +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/SavingForever/SavingForever/ViewController.m b/SavingForever/SavingForever/ViewController.m deleted file mode 100644 index 5f1f663..0000000 --- a/SavingForever/SavingForever/ViewController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// ViewController.m -// SavingForever -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -@end