From b6bff29445c420914f857d59050475197dd1a32f Mon Sep 17 00:00:00 2001 From: Justine Gartner Date: Sun, 4 Oct 2015 17:37:00 -0400 Subject: [PATCH 1/8] First commit for MarsWater --- .DS_Store | Bin 0 -> 6148 bytes MarsWater/.DS_Store | Bin 0 -> 6148 bytes MarsWater/MarsWater.xcodeproj/project.pbxproj | 361 ++++++++++++++++++ .../contents.xcworkspacedata | 2 +- .../MarsWater}/AppDelegate.h | 6 +- .../MarsWater}/AppDelegate.m | 12 +- .../AppIcon.appiconset/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 .../MarsWater/Base.lproj/Main.storyboard | 201 ++++++++++ .../MarsWater}/Info.plist | 0 MarsWater/MarsWater/List+CoreDataProperties.h | 25 ++ MarsWater/MarsWater/List+CoreDataProperties.m | 21 + MarsWater/MarsWater/List.h | 24 ++ MarsWater/MarsWater/List.m | 16 + .../ListCreationTableViewController.h | 13 + .../ListCreationTableViewController.m | 69 ++++ MarsWater/MarsWater/ListTableViewController.h | 13 + MarsWater/MarsWater/ListTableViewController.m | 120 ++++++ .../MarsWater.xcdatamodeld}/.xccurrentversion | 2 +- .../MarsWater.xcdatamodel/contents | 22 ++ MarsWater/MarsWater/Task+CoreDataProperties.h | 28 ++ MarsWater/MarsWater/Task+CoreDataProperties.m | 24 ++ MarsWater/MarsWater/Task.h | 22 ++ MarsWater/MarsWater/Task.m | 15 + .../MarsWater}/main.m | 6 +- .../SavingForever.xcodeproj/project.pbxproj | 322 ---------------- .../SavingForever/Base.lproj/Main.storyboard | 25 -- .../SavingForever.xcdatamodel/contents | 4 - SavingForever/SavingForever/ViewController.h | 15 - SavingForever/SavingForever/ViewController.m | 27 -- 30 files changed, 988 insertions(+), 407 deletions(-) create mode 100644 .DS_Store create mode 100644 MarsWater/.DS_Store create mode 100644 MarsWater/MarsWater.xcodeproj/project.pbxproj rename {SavingForever/SavingForever.xcodeproj => MarsWater/MarsWater.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (68%) rename {SavingForever/SavingForever => MarsWater/MarsWater}/AppDelegate.h (81%) rename {SavingForever/SavingForever => MarsWater/MarsWater}/AppDelegate.m (93%) rename {SavingForever/SavingForever => MarsWater/MarsWater}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {SavingForever/SavingForever => MarsWater/MarsWater}/Base.lproj/LaunchScreen.storyboard (100%) create mode 100644 MarsWater/MarsWater/Base.lproj/Main.storyboard rename {SavingForever/SavingForever => MarsWater/MarsWater}/Info.plist (100%) create mode 100644 MarsWater/MarsWater/List+CoreDataProperties.h create mode 100644 MarsWater/MarsWater/List+CoreDataProperties.m create mode 100644 MarsWater/MarsWater/List.h create mode 100644 MarsWater/MarsWater/List.m create mode 100644 MarsWater/MarsWater/ListCreationTableViewController.h create mode 100644 MarsWater/MarsWater/ListCreationTableViewController.m create mode 100644 MarsWater/MarsWater/ListTableViewController.h create mode 100644 MarsWater/MarsWater/ListTableViewController.m rename {SavingForever/SavingForever/SavingForever.xcdatamodeld => MarsWater/MarsWater/MarsWater.xcdatamodeld}/.xccurrentversion (83%) create mode 100644 MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents create mode 100644 MarsWater/MarsWater/Task+CoreDataProperties.h create mode 100644 MarsWater/MarsWater/Task+CoreDataProperties.m create mode 100644 MarsWater/MarsWater/Task.h create mode 100644 MarsWater/MarsWater/Task.m rename {SavingForever/SavingForever => MarsWater/MarsWater}/main.m (64%) delete mode 100644 SavingForever/SavingForever.xcodeproj/project.pbxproj delete mode 100644 SavingForever/SavingForever/Base.lproj/Main.storyboard delete mode 100644 SavingForever/SavingForever/SavingForever.xcdatamodeld/SavingForever.xcdatamodel/contents delete mode 100644 SavingForever/SavingForever/ViewController.h delete mode 100644 SavingForever/SavingForever/ViewController.m diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0i>5d% zL}V6r-|T$s&OS(X2Y@WL^&FT1n6fL13L{O`qoxCQo)9Ikaf3T-aE~=kM;7{vD$V^E z*UWp3XYA(xf(k8ao~EO%#p>x{zO34&vtzu!?jPB-Wm#`G74UX(ewpL<+_P!xA4YbM zJK4&aB^_fh5DWwZ!9XyO?`)-EdK6>?1HnKr@Pz@s>5 + location = "self:MarsWater.xcodeproj"> diff --git a/SavingForever/SavingForever/AppDelegate.h b/MarsWater/MarsWater/AppDelegate.h similarity index 81% rename from SavingForever/SavingForever/AppDelegate.h rename to MarsWater/MarsWater/AppDelegate.h index 6657831..7fe5645 100644 --- a/SavingForever/SavingForever/AppDelegate.h +++ b/MarsWater/MarsWater/AppDelegate.h @@ -1,9 +1,9 @@ // // AppDelegate.h -// SavingForever +// MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import diff --git a/SavingForever/SavingForever/AppDelegate.m b/MarsWater/MarsWater/AppDelegate.m similarity index 93% rename from SavingForever/SavingForever/AppDelegate.m rename to MarsWater/MarsWater/AppDelegate.m index 29b2305..1c0869a 100644 --- a/SavingForever/SavingForever/AppDelegate.m +++ b/MarsWater/MarsWater/AppDelegate.m @@ -1,9 +1,9 @@ // // AppDelegate.m -// SavingForever +// MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import "AppDelegate.h" @@ -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 "nyc.c4q.justinekay.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/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from SavingForever/SavingForever/Assets.xcassets/AppIcon.appiconset/Contents.json rename to MarsWater/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/SavingForever/SavingForever/Base.lproj/LaunchScreen.storyboard b/MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from SavingForever/SavingForever/Base.lproj/LaunchScreen.storyboard rename to MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard new file mode 100644 index 0000000..950b32a --- /dev/null +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SavingForever/SavingForever/Info.plist b/MarsWater/MarsWater/Info.plist similarity index 100% rename from SavingForever/SavingForever/Info.plist rename to MarsWater/MarsWater/Info.plist diff --git a/MarsWater/MarsWater/List+CoreDataProperties.h b/MarsWater/MarsWater/List+CoreDataProperties.h new file mode 100644 index 0000000..cd8e39d --- /dev/null +++ b/MarsWater/MarsWater/List+CoreDataProperties.h @@ -0,0 +1,25 @@ +// +// List+CoreDataProperties.h +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#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) NSArray *task; + +@end + +NS_ASSUME_NONNULL_END diff --git a/MarsWater/MarsWater/List+CoreDataProperties.m b/MarsWater/MarsWater/List+CoreDataProperties.m new file mode 100644 index 0000000..6e9e7c8 --- /dev/null +++ b/MarsWater/MarsWater/List+CoreDataProperties.m @@ -0,0 +1,21 @@ +// +// List+CoreDataProperties.m +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "List+CoreDataProperties.h" + +@implementation List (CoreDataProperties) + +@dynamic title; +@dynamic createdAt; +@dynamic color; +@dynamic task; + +@end diff --git a/MarsWater/MarsWater/List.h b/MarsWater/MarsWater/List.h new file mode 100644 index 0000000..cc84526 --- /dev/null +++ b/MarsWater/MarsWater/List.h @@ -0,0 +1,24 @@ +// +// List.h +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import +#import + +@class Task; + +NS_ASSUME_NONNULL_BEGIN + +@interface List : NSManagedObject + +// Insert code here to declare functionality of your managed object subclass + +@end + +NS_ASSUME_NONNULL_END + +#import "List+CoreDataProperties.h" diff --git a/MarsWater/MarsWater/List.m b/MarsWater/MarsWater/List.m new file mode 100644 index 0000000..98eaa9c --- /dev/null +++ b/MarsWater/MarsWater/List.m @@ -0,0 +1,16 @@ +// +// List.m +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import "List.h" +#import "Task.h" + +@implementation List + +// Insert code here to add functionality to your managed object subclass + +@end diff --git a/MarsWater/MarsWater/ListCreationTableViewController.h b/MarsWater/MarsWater/ListCreationTableViewController.h new file mode 100644 index 0000000..3210ab6 --- /dev/null +++ b/MarsWater/MarsWater/ListCreationTableViewController.h @@ -0,0 +1,13 @@ +// +// ListCreationTableViewController.h +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import + +@interface ListCreationTableViewController : UITableViewController + +@end diff --git a/MarsWater/MarsWater/ListCreationTableViewController.m b/MarsWater/MarsWater/ListCreationTableViewController.m new file mode 100644 index 0000000..06c943c --- /dev/null +++ b/MarsWater/MarsWater/ListCreationTableViewController.m @@ -0,0 +1,69 @@ +// +// ListCreationTableViewController.m +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. 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; + +@end + +@implementation ListCreationTableViewController + +-(void)viewDidLoad{ + + [super viewDidLoad]; + + [self setupNavigationBar]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.list = [NSEntityDescription insertNewObjectForEntityForName:@"List" inManagedObjectContext:delegate.managedObjectContext]; + +} + +-(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{ + + self.list.title = self.titleTextField.text; + self.list.createdAt = [NSDate date]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + [delegate.managedObjectContext save:nil]; + + [self dismissViewControllerAnimated:YES completion:nil]; + + NSLog(@"%@", self.list); +} + +- (IBAction)colorButtonTapped:(UIButton *)sender { + + self.list.color = sender.backgroundColor; + + +} + +@end diff --git a/MarsWater/MarsWater/ListTableViewController.h b/MarsWater/MarsWater/ListTableViewController.h new file mode 100644 index 0000000..851d655 --- /dev/null +++ b/MarsWater/MarsWater/ListTableViewController.h @@ -0,0 +1,13 @@ +// +// ListTableViewController.h +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import + +@interface ListTableViewController : UITableViewController + +@end diff --git a/MarsWater/MarsWater/ListTableViewController.m b/MarsWater/MarsWater/ListTableViewController.m new file mode 100644 index 0000000..d3e6073 --- /dev/null +++ b/MarsWater/MarsWater/ListTableViewController.m @@ -0,0 +1,120 @@ +// +// ListTableViewController.m +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import +#import "ListTableViewController.h" +#import "AppDelegate.h" +#import "List.h" + +@interface ListTableViewController () + +@property(nonatomic) NSFetchedResultsController *fetchedResultsController; + +@end + +@implementation ListTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + //Create an instance of NSFetchRequest with an entity name + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"List"]; + + //create a sort descriptor + NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; + + //set the sort descriptors on the fetchRequest + fetchRequest.sortDescriptors = @[sort]; + + //create a fetchedResultsController with a fetchRequest and a managedObjectContext + self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + + self.fetchedResultsController.delegate = self; + + [self.fetchedResultsController performFetch:nil]; + + [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.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{ + + [self.tableView reloadData]; +} + +/* +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the specified item to be editable. + return YES; +} +*/ + +/* +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } +} +*/ + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { +} +*/ + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion b/MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion similarity index 83% rename from SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion rename to MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion index 352ed15..5c0cbd5 100644 --- a/SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - SavingForever.xcdatamodel + MarsWater.xcdatamodel diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents new file mode 100644 index 0000000..a2fd0bb --- /dev/null +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.h b/MarsWater/MarsWater/Task+CoreDataProperties.h new file mode 100644 index 0000000..9d5fe52 --- /dev/null +++ b/MarsWater/MarsWater/Task+CoreDataProperties.h @@ -0,0 +1,28 @@ +// +// Task+CoreDataProperties.h +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#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 *dueDate; +@property (nullable, nonatomic, retain) NSDate *updatedAt; +@property (nullable, nonatomic, retain) NSNumber *priority; +@property (nullable, nonatomic, retain) NSDate *completedAt; +@property (nullable, nonatomic, retain) NSManagedObject *list; + +@end + +NS_ASSUME_NONNULL_END diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.m b/MarsWater/MarsWater/Task+CoreDataProperties.m new file mode 100644 index 0000000..527f35b --- /dev/null +++ b/MarsWater/MarsWater/Task+CoreDataProperties.m @@ -0,0 +1,24 @@ +// +// Task+CoreDataProperties.m +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "Task+CoreDataProperties.h" + +@implementation Task (CoreDataProperties) + +@dynamic taskDescription; +@dynamic createdAt; +@dynamic dueDate; +@dynamic updatedAt; +@dynamic priority; +@dynamic completedAt; +@dynamic list; + +@end diff --git a/MarsWater/MarsWater/Task.h b/MarsWater/MarsWater/Task.h new file mode 100644 index 0000000..748cff5 --- /dev/null +++ b/MarsWater/MarsWater/Task.h @@ -0,0 +1,22 @@ +// +// Task.h +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import +#import + +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/MarsWater/Task.m b/MarsWater/MarsWater/Task.m new file mode 100644 index 0000000..e916539 --- /dev/null +++ b/MarsWater/MarsWater/Task.m @@ -0,0 +1,15 @@ +// +// Task.m +// MarsWater +// +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import "Task.h" + +@implementation Task + +// Insert code here to add functionality to your managed object subclass + +@end diff --git a/SavingForever/SavingForever/main.m b/MarsWater/MarsWater/main.m similarity index 64% rename from SavingForever/SavingForever/main.m rename to MarsWater/MarsWater/main.m index 0d1314d..5c2db3b 100644 --- a/SavingForever/SavingForever/main.m +++ b/MarsWater/MarsWater/main.m @@ -1,9 +1,9 @@ // // main.m -// SavingForever +// MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Justine Gartner on 10/4/15. +// Copyright © 2015 Justine Gartner. All rights reserved. // #import diff --git a/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.h b/SavingForever/SavingForever/ViewController.h deleted file mode 100644 index b193f94..0000000 --- a/SavingForever/SavingForever/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// SavingForever -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - 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 From 6987dfcb24001975bb4ce5ccd5fc511bc586ae64 Mon Sep 17 00:00:00 2001 From: Justine Gartner Date: Sun, 4 Oct 2015 17:55:35 -0400 Subject: [PATCH 2/8] updated ListTableViewController custom class in storyboard ;) --- MarsWater/.DS_Store | Bin 6148 -> 6148 bytes .../MarsWater/Base.lproj/Main.storyboard | 4 ++-- MarsWater/MarsWater/ListTableViewController.m | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store index b78edbec4cdd9ffe5e2a097c513a085d205852b3..a191a481bd600e9c510ad998fff753ae37329582 100644 GIT binary patch delta 33 pcmZoMXffE}!pQWkZgK;o&g3G-hRt6^_?b5gFtIUjX6N|J4*<$g3j_cF delta 33 pcmZoMXffE}!pQXd@Z<(YoykRv4U7hx8JXDFCN}VGX6N|J4* - + @@ -60,7 +60,6 @@ - @@ -178,6 +177,7 @@ + diff --git a/MarsWater/MarsWater/ListTableViewController.m b/MarsWater/MarsWater/ListTableViewController.m index d3e6073..d368e8f 100644 --- a/MarsWater/MarsWater/ListTableViewController.m +++ b/MarsWater/MarsWater/ListTableViewController.m @@ -40,7 +40,6 @@ - (void)viewDidLoad { [self.fetchedResultsController performFetch:nil]; - [self.tableView reloadData]; } #pragma mark - Table view data source From 2a6db6fb0e08c6706a8ca7824cc33fde132a3cdb Mon Sep 17 00:00:00 2001 From: ayunav Date: Mon, 5 Oct 2015 21:19:52 -0400 Subject: [PATCH 3/8] deleted all the files --- LICENSE | 22 -- MarsWater/MarsWater.xcodeproj/project.pbxproj | 360 ------------------ .../contents.xcworkspacedata | 7 - MarsWater/MarsWater/AppDelegate.h | 25 -- MarsWater/MarsWater/AppDelegate.m | 127 ------ .../AppIcon.appiconset/Contents.json | 38 -- .../Base.lproj/LaunchScreen.storyboard | 27 -- .../MarsWater/Base.lproj/Main.storyboard | 236 ------------ MarsWater/MarsWater/Info.plist | 40 -- MarsWater/MarsWater/List+CoreDataProperties.h | 25 -- MarsWater/MarsWater/List+CoreDataProperties.m | 21 - MarsWater/MarsWater/List.h | 22 -- MarsWater/MarsWater/List.m | 15 - .../ListCreationTableViewController.h | 13 - .../ListCreationTableViewController.m | 63 --- .../MarsWater/ListsTableViewController.h | 13 - .../MarsWater/ListsTableViewController.m | 76 ---- .../MarsWater.xcdatamodeld/.xccurrentversion | 8 - .../MarsWater.xcdatamodel/contents | 22 -- MarsWater/MarsWater/Task+CoreDataProperties.h | 28 -- MarsWater/MarsWater/Task+CoreDataProperties.m | 24 -- MarsWater/MarsWater/Task.h | 24 -- MarsWater/MarsWater/Task.m | 16 - MarsWater/MarsWater/main.m | 16 - README.md | 11 - 25 files changed, 1279 deletions(-) delete mode 100644 LICENSE delete mode 100644 MarsWater/MarsWater.xcodeproj/project.pbxproj delete mode 100644 MarsWater/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 MarsWater/MarsWater/AppDelegate.h delete mode 100644 MarsWater/MarsWater/AppDelegate.m delete mode 100644 MarsWater/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard delete mode 100644 MarsWater/MarsWater/Base.lproj/Main.storyboard delete mode 100644 MarsWater/MarsWater/Info.plist delete mode 100644 MarsWater/MarsWater/List+CoreDataProperties.h delete mode 100644 MarsWater/MarsWater/List+CoreDataProperties.m delete mode 100644 MarsWater/MarsWater/List.h delete mode 100644 MarsWater/MarsWater/List.m delete mode 100644 MarsWater/MarsWater/ListCreationTableViewController.h delete mode 100644 MarsWater/MarsWater/ListCreationTableViewController.m delete mode 100644 MarsWater/MarsWater/ListsTableViewController.h delete mode 100644 MarsWater/MarsWater/ListsTableViewController.m delete mode 100644 MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion delete mode 100644 MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents delete mode 100644 MarsWater/MarsWater/Task+CoreDataProperties.h delete mode 100644 MarsWater/MarsWater/Task+CoreDataProperties.m delete mode 100644 MarsWater/MarsWater/Task.h delete mode 100644 MarsWater/MarsWater/Task.m delete mode 100644 MarsWater/MarsWater/main.m delete mode 100644 README.md diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d8e4c2f..0000000 --- a/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 C4Q Access Code 2.2 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/MarsWater/MarsWater.xcodeproj/project.pbxproj b/MarsWater/MarsWater.xcodeproj/project.pbxproj deleted file mode 100644 index 61d423d..0000000 --- a/MarsWater/MarsWater.xcodeproj/project.pbxproj +++ /dev/null @@ -1,360 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 8DA86CA91BC1AE57006C50BC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CA81BC1AE57006C50BC /* main.m */; }; - 8DA86CAC1BC1AE57006C50BC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */; }; - 8DA86CB21BC1AE57006C50BC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB01BC1AE57006C50BC /* Main.storyboard */; }; - 8DA86CB51BC1AE57006C50BC /* MarsWater.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */; }; - 8DA86CB71BC1AE57006C50BC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */; }; - 8DA86CBA1BC1AE57006C50BC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */; }; - 8DA86CCD1BC1B31C006C50BC /* List+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CC61BC1B31C006C50BC /* List+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CCE1BC1B31C006C50BC /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CC81BC1B31C006C50BC /* List.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CCF1BC1B31C006C50BC /* Task+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CCA1BC1B31C006C50BC /* Task+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CD01BC1B31C006C50BC /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CCC1BC1B31C006C50BC /* Task.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CD41BC1B8E4006C50BC /* ListsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */; settings = {ASSET_TAGS = (); }; }; - 8DA86CD71BC1B904006C50BC /* ListCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */; settings = {ASSET_TAGS = (); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 8DA86CA41BC1AE57006C50BC /* MarsWater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarsWater.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 8DA86CA81BC1AE57006C50BC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 8DA86CAA1BC1AE57006C50BC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8DA86CB11BC1AE57006C50BC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MarsWater.xcdatamodel; sourceTree = ""; }; - 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 8DA86CB91BC1AE57006C50BC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 8DA86CBB1BC1AE57006C50BC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DA86CC51BC1B31C006C50BC /* List+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "List+CoreDataProperties.h"; path = "../List+CoreDataProperties.h"; sourceTree = ""; }; - 8DA86CC61BC1B31C006C50BC /* List+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "List+CoreDataProperties.m"; path = "../List+CoreDataProperties.m"; sourceTree = ""; }; - 8DA86CC71BC1B31C006C50BC /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = List.h; path = ../List.h; sourceTree = ""; }; - 8DA86CC81BC1B31C006C50BC /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = List.m; path = ../List.m; sourceTree = ""; }; - 8DA86CC91BC1B31C006C50BC /* Task+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Task+CoreDataProperties.h"; path = "../Task+CoreDataProperties.h"; sourceTree = ""; }; - 8DA86CCA1BC1B31C006C50BC /* Task+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "Task+CoreDataProperties.m"; path = "../Task+CoreDataProperties.m"; sourceTree = ""; }; - 8DA86CCB1BC1B31C006C50BC /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Task.h; path = ../Task.h; sourceTree = ""; }; - 8DA86CCC1BC1B31C006C50BC /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Task.m; path = ../Task.m; sourceTree = ""; }; - 8DA86CD21BC1B8E4006C50BC /* ListsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListsTableViewController.h; sourceTree = ""; }; - 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListsTableViewController.m; sourceTree = ""; }; - 8DA86CD51BC1B904006C50BC /* ListCreationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListCreationTableViewController.h; sourceTree = ""; }; - 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListCreationTableViewController.m; sourceTree = ""; }; -/* 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 */, - 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 = ( - 8DA86CC51BC1B31C006C50BC /* List+CoreDataProperties.h */, - 8DA86CC61BC1B31C006C50BC /* List+CoreDataProperties.m */, - 8DA86CC71BC1B31C006C50BC /* List.h */, - 8DA86CC81BC1B31C006C50BC /* List.m */, - 8DA86CC91BC1B31C006C50BC /* Task+CoreDataProperties.h */, - 8DA86CCA1BC1B31C006C50BC /* Task+CoreDataProperties.m */, - 8DA86CCB1BC1B31C006C50BC /* Task.h */, - 8DA86CCC1BC1B31C006C50BC /* Task.m */, - ); - 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 */, - 8DA86CCF1BC1B31C006C50BC /* Task+CoreDataProperties.m in Sources */, - 8DA86CAC1BC1AE57006C50BC /* AppDelegate.m in Sources */, - 8DA86CD41BC1B8E4006C50BC /* ListsTableViewController.m in Sources */, - 8DA86CD01BC1B31C006C50BC /* Task.m in Sources */, - 8DA86CCE1BC1B31C006C50BC /* List.m in Sources */, - 8DA86CD71BC1B904006C50BC /* ListCreationTableViewController.m in Sources */, - 8DA86CCD1BC1B31C006C50BC /* List+CoreDataProperties.m in Sources */, - 8DA86CA91BC1AE57006C50BC /* main.m in Sources */, - ); - 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; - }; -/* 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/MarsWater/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MarsWater/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 4acdfe2..0000000 --- a/MarsWater/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/MarsWater/MarsWater/AppDelegate.h b/MarsWater/MarsWater/AppDelegate.h deleted file mode 100644 index 33642bf..0000000 --- a/MarsWater/MarsWater/AppDelegate.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// AppDelegate.h -// MarsWater -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; -@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; -@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; - -- (void)saveContext; -- (NSURL *)applicationDocumentsDirectory; - - -@end - diff --git a/MarsWater/MarsWater/AppDelegate.m b/MarsWater/MarsWater/AppDelegate.m deleted file mode 100644 index 8e592d7..0000000 --- a/MarsWater/MarsWater/AppDelegate.m +++ /dev/null @@ -1,127 +0,0 @@ -// -// AppDelegate.m -// MarsWater -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import "AppDelegate.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - // Saves changes in the application's managed object context before the application terminates. - [self saveContext]; -} - -#pragma mark - Core Data stack - -@synthesize managedObjectContext = _managedObjectContext; -@synthesize managedObjectModel = _managedObjectModel; -@synthesize persistentStoreCoordinator = _persistentStoreCoordinator; - -- (NSURL *)applicationDocumentsDirectory { - // The directory the application uses to store the Core Data store file. This code uses a directory named "com.mikekavouras.MarsWater" in the application's documents directory. - return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; -} - -- (NSManagedObjectModel *)managedObjectModel { - // The managed object model for the application. It is a fatal error for the application not to be able to find and load its model. - if (_managedObjectModel != nil) { - return _managedObjectModel; - } - NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MarsWater" withExtension:@"momd"]; - _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; - return _managedObjectModel; -} - -- (NSPersistentStoreCoordinator *)persistentStoreCoordinator { - // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. - if (_persistentStoreCoordinator != nil) { - return _persistentStoreCoordinator; - } - - // Create the coordinator and store - - _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; - NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MarsWater.sqlite"]; - NSError *error = nil; - NSString *failureReason = @"There was an error creating or loading the application's saved data."; - if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { - // Report any error we got. - NSMutableDictionary *dict = [NSMutableDictionary dictionary]; - dict[NSLocalizedDescriptionKey] = @"Failed to initialize the application's saved data"; - dict[NSLocalizedFailureReasonErrorKey] = failureReason; - dict[NSUnderlyingErrorKey] = error; - error = [NSError errorWithDomain:@"YOUR_ERROR_DOMAIN" code:9999 userInfo:dict]; - // Replace this with code to handle the error appropriately. - // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. - NSLog(@"Unresolved error %@, %@", error, [error userInfo]); - abort(); - } - - return _persistentStoreCoordinator; -} - - -- (NSManagedObjectContext *)managedObjectContext { - // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) - if (_managedObjectContext != nil) { - return _managedObjectContext; - } - - NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; - if (!coordinator) { - return nil; - } - _managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; - [_managedObjectContext setPersistentStoreCoordinator:coordinator]; - return _managedObjectContext; -} - -#pragma mark - Core Data Saving support - -- (void)saveContext { - NSManagedObjectContext *managedObjectContext = self.managedObjectContext; - if (managedObjectContext != nil) { - NSError *error = nil; - if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { - // Replace this implementation with code to handle the error appropriately. - // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. - NSLog(@"Unresolved error %@, %@", error, [error userInfo]); - abort(); - } - } -} - -@end diff --git a/MarsWater/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json b/MarsWater/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 118c98f..0000000 --- a/MarsWater/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard b/MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1..0000000 --- a/MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard deleted file mode 100644 index 13ead89..0000000 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MarsWater/MarsWater/Info.plist b/MarsWater/MarsWater/Info.plist deleted file mode 100644 index 6905cc6..0000000 --- a/MarsWater/MarsWater/Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/MarsWater/MarsWater/List+CoreDataProperties.h b/MarsWater/MarsWater/List+CoreDataProperties.h deleted file mode 100644 index 9ce8d06..0000000 --- a/MarsWater/MarsWater/List+CoreDataProperties.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// 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) NSArray *task; - -@end - -NS_ASSUME_NONNULL_END diff --git a/MarsWater/MarsWater/List+CoreDataProperties.m b/MarsWater/MarsWater/List+CoreDataProperties.m deleted file mode 100644 index 6c70870..0000000 --- a/MarsWater/MarsWater/List+CoreDataProperties.m +++ /dev/null @@ -1,21 +0,0 @@ -// -// 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/MarsWater/List.h b/MarsWater/MarsWater/List.h deleted file mode 100644 index d7c69f2..0000000 --- a/MarsWater/MarsWater/List.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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/MarsWater/List.m b/MarsWater/MarsWater/List.m deleted file mode 100644 index 5edadfa..0000000 --- a/MarsWater/MarsWater/List.m +++ /dev/null @@ -1,15 +0,0 @@ -// -// 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/MarsWater/ListCreationTableViewController.h b/MarsWater/MarsWater/ListCreationTableViewController.h deleted file mode 100644 index df226d4..0000000 --- a/MarsWater/MarsWater/ListCreationTableViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ListCreationTableViewController.h -// MarsWater -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import - -@interface ListCreationTableViewController : UITableViewController - -@end diff --git a/MarsWater/MarsWater/ListCreationTableViewController.m b/MarsWater/MarsWater/ListCreationTableViewController.m deleted file mode 100644 index 0ecf6e9..0000000 --- a/MarsWater/MarsWater/ListCreationTableViewController.m +++ /dev/null @@ -1,63 +0,0 @@ -// -// 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; - -@end - -@implementation ListCreationTableViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - [self setupNavigationBar]; - - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - - self.list = [NSEntityDescription insertNewObjectForEntityForName:@"List" inManagedObjectContext:delegate.managedObjectContext]; -} - -- (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)]; - - // set the right button to save -} - -- (void)cancel { - [self dismissViewControllerAnimated:YES completion:nil]; -} - -- (void)save { - self.list.title = self.titleTextField.text; - self.list.createdAt = [NSDate date]; - - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - [delegate.managedObjectContext save:nil]; - - [self dismissViewControllerAnimated:YES completion:nil]; -} - -- (IBAction)colorButtonTapped:(UIButton *)sender { - self.list.color = sender.backgroundColor; -} - -@end diff --git a/MarsWater/MarsWater/ListsTableViewController.h b/MarsWater/MarsWater/ListsTableViewController.h deleted file mode 100644 index e83a1d1..0000000 --- a/MarsWater/MarsWater/ListsTableViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ListsTableViewController.h -// MarsWater -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import - -@interface ListsTableViewController : UITableViewController - -@end diff --git a/MarsWater/MarsWater/ListsTableViewController.m b/MarsWater/MarsWater/ListsTableViewController.m deleted file mode 100644 index 8a2659c..0000000 --- a/MarsWater/MarsWater/ListsTableViewController.m +++ /dev/null @@ -1,76 +0,0 @@ -// -// 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" - -@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)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { - - [self.tableView reloadData]; -} - -@end - diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion b/MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion deleted file mode 100644 index 5c0cbd5..0000000 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion +++ /dev/null @@ -1,8 +0,0 @@ - - - - - _XCCurrentVersionName - MarsWater.xcdatamodel - - diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents deleted file mode 100644 index 116441d..0000000 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.h b/MarsWater/MarsWater/Task+CoreDataProperties.h deleted file mode 100644 index 2cc11d7..0000000 --- a/MarsWater/MarsWater/Task+CoreDataProperties.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// 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; - -@end - -NS_ASSUME_NONNULL_END diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.m b/MarsWater/MarsWater/Task+CoreDataProperties.m deleted file mode 100644 index 1ea972c..0000000 --- a/MarsWater/MarsWater/Task+CoreDataProperties.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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; - -@end diff --git a/MarsWater/MarsWater/Task.h b/MarsWater/MarsWater/Task.h deleted file mode 100644 index e714efc..0000000 --- a/MarsWater/MarsWater/Task.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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/MarsWater/Task.m b/MarsWater/MarsWater/Task.m deleted file mode 100644 index c32ed42..0000000 --- a/MarsWater/MarsWater/Task.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// 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/MarsWater/main.m b/MarsWater/MarsWater/main.m deleted file mode 100644 index c107d8b..0000000 --- a/MarsWater/MarsWater/main.m +++ /dev/null @@ -1,16 +0,0 @@ - -// main.m -// MarsWater -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/README.md b/README.md deleted file mode 100644 index 6cccc97..0000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Todo Core Data - -The project file for this weeks homework has some starter code. Specifically, there is an established `NSManagedObjectModel` (MarsWater.xcdatamodeld) and classes for each respective `Entity`. -The code in place successfully creates and saves `List` objects. - -The minimum requirement for your assignment is to create the functionality that supports creating `Task` objects, adding `Task` objects to a list, and saving the list. -You can determine the UX to make this happen, but it should be apparent that the tasks have been saved to the list. - -**Bonus options:** -* Allow users to edit a List/Task -* Allow users to delete a List/Task From 3c22be804d06878bc4c53a70f5b074e9af2cb3a9 Mon Sep 17 00:00:00 2001 From: ayunav Date: Mon, 5 Oct 2015 21:54:14 -0400 Subject: [PATCH 4/8] added tasks vc with the navigation vc. --- MarsWater/.DS_Store | Bin 6148 -> 6148 bytes .../MarsWater/Base.lproj/Main.storyboard | 143 ++++++++++++++++++ 2 files changed, 143 insertions(+) diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store index a191a481bd600e9c510ad998fff753ae37329582..96df7b65110b458b2391634da3ab343adb644c41 100644 GIT binary patch delta 68 zcmZoMXffE}!pKx}V{!wd4v&jVN@+dl6CQ P%>qnp%$wOc{_+C=gxC{v diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard index 1f42317..e74cf32 100644 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -20,6 +20,9 @@ + + + @@ -197,5 +200,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d23c889222db48e548c9a5700137f75c750ad68a Mon Sep 17 00:00:00 2001 From: ayunav Date: Wed, 7 Oct 2015 22:00:59 -0400 Subject: [PATCH 5/8] added code for detail textlabel text. Went over the code with Tanner. --- MarsWater/.DS_Store | Bin 6148 -> 6148 bytes MarsWater/MarsWater.xcodeproj/project.pbxproj | 41 +++++--- MarsWater/MarsWater/AppDelegate.m | 67 ++++++------ .../MarsWater/Base.lproj/Main.storyboard | 31 ++++-- ...ller.h => CreateListTableViewController.h} | 2 +- ...ller.m => CreateListTableViewController.m} | 9 +- ...ontroller.h => ListsTableViewController.h} | 2 +- ...ontroller.m => ListsTableViewController.m} | 25 +++-- .../MarsWater.xcdatamodel/contents | 2 +- .../MarsWater/TasksTableViewController.h | 13 +++ .../MarsWater/TasksTableViewController.m | 98 ++++++++++++++++++ 11 files changed, 222 insertions(+), 68 deletions(-) rename MarsWater/MarsWater/{ListCreationTableViewController.h => CreateListTableViewController.h} (74%) rename MarsWater/MarsWater/{ListCreationTableViewController.m => CreateListTableViewController.m} (89%) rename MarsWater/MarsWater/{ListTableViewController.h => ListsTableViewController.h} (75%) rename MarsWater/MarsWater/{ListTableViewController.m => ListsTableViewController.m} (87%) create mode 100644 MarsWater/MarsWater/TasksTableViewController.h create mode 100644 MarsWater/MarsWater/TasksTableViewController.m diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store index 9a672130207bc1045d15b714bbe23a943479b189..d865f9afcee8d9a803d0fdc6e20a6b81ffa0997d 100644 GIT binary patch delta 67 zcmZoMXffE}!pL;~>f{DS9Ud2#l+u!928K)41%Z?67|ofjW9|WI9lnAL!{Frn+yVv= TVBE~e#KtzUfqyeQ$6tN`=S>tJ delta 68 zcmZoMXffE}!pPKdZgK;o4v&jVN@+ - + - + + + + + @@ -63,7 +79,7 @@ - + @@ -223,13 +239,14 @@ - - + + + - + @@ -254,7 +271,7 @@ - + diff --git a/MarsWater/MarsWater/ListCreationTableViewController.h b/MarsWater/MarsWater/CreateListTableViewController.h similarity index 74% rename from MarsWater/MarsWater/ListCreationTableViewController.h rename to MarsWater/MarsWater/CreateListTableViewController.h index 3210ab6..bb204b0 100644 --- a/MarsWater/MarsWater/ListCreationTableViewController.h +++ b/MarsWater/MarsWater/CreateListTableViewController.h @@ -8,6 +8,6 @@ #import -@interface ListCreationTableViewController : UITableViewController +@interface CreateListTableViewController : UITableViewController @end diff --git a/MarsWater/MarsWater/ListCreationTableViewController.m b/MarsWater/MarsWater/CreateListTableViewController.m similarity index 89% rename from MarsWater/MarsWater/ListCreationTableViewController.m rename to MarsWater/MarsWater/CreateListTableViewController.m index 06c943c..ea616c7 100644 --- a/MarsWater/MarsWater/ListCreationTableViewController.m +++ b/MarsWater/MarsWater/CreateListTableViewController.m @@ -7,11 +7,12 @@ // #import -#import "ListCreationTableViewController.h" + +#import "CreateListTableViewController.h" #import "List.h" #import "AppDelegate.h" -@interface ListCreationTableViewController () +@interface CreateListTableViewController () @property (weak, nonatomic) IBOutlet UITextField *titleTextField; @@ -19,7 +20,7 @@ @interface ListCreationTableViewController () @end -@implementation ListCreationTableViewController +@implementation CreateListTableViewController -(void)viewDidLoad{ @@ -52,7 +53,7 @@ -(void)save{ self.list.createdAt = [NSDate date]; AppDelegate *delegate = [UIApplication sharedApplication].delegate; - [delegate.managedObjectContext save:nil]; + [delegate.managedObjectContext save:nil]; [self dismissViewControllerAnimated:YES completion:nil]; diff --git a/MarsWater/MarsWater/ListTableViewController.h b/MarsWater/MarsWater/ListsTableViewController.h similarity index 75% rename from MarsWater/MarsWater/ListTableViewController.h rename to MarsWater/MarsWater/ListsTableViewController.h index 851d655..1a1918c 100644 --- a/MarsWater/MarsWater/ListTableViewController.h +++ b/MarsWater/MarsWater/ListsTableViewController.h @@ -8,6 +8,6 @@ #import -@interface ListTableViewController : UITableViewController +@interface ListsTableViewController : UITableViewController @end diff --git a/MarsWater/MarsWater/ListTableViewController.m b/MarsWater/MarsWater/ListsTableViewController.m similarity index 87% rename from MarsWater/MarsWater/ListTableViewController.m rename to MarsWater/MarsWater/ListsTableViewController.m index d368e8f..e23a614 100644 --- a/MarsWater/MarsWater/ListTableViewController.m +++ b/MarsWater/MarsWater/ListsTableViewController.m @@ -7,17 +7,19 @@ // #import -#import "ListTableViewController.h" + +#import "ListsTableViewController.h" #import "AppDelegate.h" #import "List.h" -@interface ListTableViewController () +@interface ListsTableViewController () -@property(nonatomic) NSFetchedResultsController *fetchedResultsController; +@property (nonatomic) NSFetchedResultsController *fetchedResultsController; @end -@implementation ListTableViewController + +@implementation ListsTableViewController - (void)viewDidLoad { [super viewDidLoad]; @@ -56,17 +58,28 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ListCellIdentifier" forIndexPath:indexPath]; List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + cell.textLabel.text = list.title; - cell.detailTextLabel.text = [list.createdAt description]; + + + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.dateStyle = NSDateFormatterShortStyle; + + cell.detailTextLabel.text = [formatter stringFromDate:list.createdAt]; + + + + cell.backgroundColor = (UIColor *)list.color; return cell; } - +// NSFetchResultsController delegate method -(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath{ [self.tableView reloadData]; diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents index a2fd0bb..fc42e46 100644 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/MarsWater/MarsWater/TasksTableViewController.h b/MarsWater/MarsWater/TasksTableViewController.h new file mode 100644 index 0000000..140c467 --- /dev/null +++ b/MarsWater/MarsWater/TasksTableViewController.h @@ -0,0 +1,13 @@ +// +// TasksTableViewController.h +// MarsWater +// +// Created by Ayuna Vogel on 10/7/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import + +@interface TasksTableViewController : UITableViewController + +@end diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m new file mode 100644 index 0000000..030b801 --- /dev/null +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -0,0 +1,98 @@ +// +// TasksTableViewController.m +// MarsWater +// +// Created by Ayuna Vogel on 10/7/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import "TasksTableViewController.h" + +@interface TasksTableViewController () + +@end + +@implementation TasksTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +#warning Incomplete implementation, return the number of sections + return 0; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +#warning Incomplete implementation, return the number of rows + return 0; +} + +/* +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; + + // Configure the cell... + + return cell; +} +*/ + +/* +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the specified item to be editable. + return YES; +} +*/ + +/* +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } +} +*/ + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { +} +*/ + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end From fcee9b332afd73f4a91e78237f9b508111497863 Mon Sep 17 00:00:00 2001 From: ayunav Date: Thu, 8 Oct 2015 12:01:55 -0400 Subject: [PATCH 6/8] added methods for Tasks VC and Create Task VC. --- MarsWater/.DS_Store | Bin 6148 -> 6148 bytes MarsWater/MarsWater.xcodeproj/project.pbxproj | 6 + .../MarsWater/Base.lproj/Main.storyboard | 6 +- .../MarsWater/CreateTaskTableViewController.h | 13 ++ .../MarsWater/CreateTaskTableViewController.m | 146 ++++++++++++++++++ .../MarsWater.xcdatamodel/contents | 3 +- MarsWater/MarsWater/Task+CoreDataProperties.h | 1 + MarsWater/MarsWater/Task+CoreDataProperties.m | 1 + .../MarsWater/TasksTableViewController.m | 54 +++++-- 9 files changed, 217 insertions(+), 13 deletions(-) create mode 100644 MarsWater/MarsWater/CreateTaskTableViewController.h create mode 100644 MarsWater/MarsWater/CreateTaskTableViewController.m diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store index d865f9afcee8d9a803d0fdc6e20a6b81ffa0997d..d1c4de07aa4a6321bbd3a20c5bbca3b7269f36ec 100644 GIT binary patch delta 69 zcmZoMXffE}%*f0rt~j}YQHRIHC8e|^nStSwjpC`vb&TfB5L$=7Aj2>?IX}060R$KW SHZwA@u}y5?+sw}KmmdJ8UJ~H| delta 68 zcmZoMXffE}%*f1e{_5lgMjaj(mz2_yWCn&y)&+r+>ln?Mtz+&1X&t_T48!2${M-Tt U5MbQQ$i&7rv4MXxJI7ys0O_j~9{>OV diff --git a/MarsWater/MarsWater.xcodeproj/project.pbxproj b/MarsWater/MarsWater.xcodeproj/project.pbxproj index e7fb332..7c063b4 100644 --- a/MarsWater/MarsWater.xcodeproj/project.pbxproj +++ b/MarsWater/MarsWater.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 2957127E1BC5F7500090AEA6 /* TasksTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2957127D1BC5F7500090AEA6 /* TasksTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 295712811BC6A8C90090AEA6 /* CreateTaskTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 295712801BC6A8C90090AEA6 /* CreateTaskTableViewController.m */; settings = {ASSET_TAGS = (); }; }; 6B80EDD91BC1AE4300283EB5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDD81BC1AE4300283EB5 /* main.m */; }; 6B80EDDC1BC1AE4300283EB5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B80EDDB1BC1AE4300283EB5 /* AppDelegate.m */; }; 6B80EDE21BC1AE4300283EB5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B80EDE01BC1AE4300283EB5 /* Main.storyboard */; }; @@ -25,6 +26,8 @@ /* Begin PBXFileReference section */ 2957127C1BC5F7500090AEA6 /* TasksTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TasksTableViewController.h; sourceTree = ""; }; 2957127D1BC5F7500090AEA6 /* TasksTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TasksTableViewController.m; sourceTree = ""; }; + 2957127F1BC6A8C90090AEA6 /* CreateTaskTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateTaskTableViewController.h; sourceTree = ""; }; + 295712801BC6A8C90090AEA6 /* CreateTaskTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CreateTaskTableViewController.m; sourceTree = ""; }; 6B80EDD41BC1AE4300283EB5 /* MarsWater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarsWater.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6B80EDD81BC1AE4300283EB5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 6B80EDDA1BC1AE4300283EB5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -88,6 +91,8 @@ 6B80EE051BC1B93700283EB5 /* CreateListTableViewController.m */, 2957127C1BC5F7500090AEA6 /* TasksTableViewController.h */, 2957127D1BC5F7500090AEA6 /* TasksTableViewController.m */, + 2957127F1BC6A8C90090AEA6 /* CreateTaskTableViewController.h */, + 295712801BC6A8C90090AEA6 /* CreateTaskTableViewController.m */, 6B80EDE61BC1AE4300283EB5 /* Assets.xcassets */, 6B80EDE81BC1AE4300283EB5 /* LaunchScreen.storyboard */, 6B80EDEB1BC1AE4300283EB5 /* Info.plist */, @@ -191,6 +196,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 295712811BC6A8C90090AEA6 /* CreateTaskTableViewController.m in Sources */, 6B80EDE51BC1AE4300283EB5 /* MarsWater.xcdatamodeld in Sources */, 6B80EDFD1BC1B32700283EB5 /* Task+CoreDataProperties.m in Sources */, 6B80EDDC1BC1AE4300283EB5 /* AppDelegate.m in Sources */, diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard index 4333299..4ae66d7 100644 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -219,13 +219,13 @@ - + - + @@ -271,7 +271,7 @@ - + diff --git a/MarsWater/MarsWater/CreateTaskTableViewController.h b/MarsWater/MarsWater/CreateTaskTableViewController.h new file mode 100644 index 0000000..aaaca9f --- /dev/null +++ b/MarsWater/MarsWater/CreateTaskTableViewController.h @@ -0,0 +1,13 @@ +// +// CreateTaskTableViewController.h +// MarsWater +// +// Created by Ayuna Vogel on 10/8/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// + +#import + +@interface CreateTaskTableViewController : UITableViewController + +@end diff --git a/MarsWater/MarsWater/CreateTaskTableViewController.m b/MarsWater/MarsWater/CreateTaskTableViewController.m new file mode 100644 index 0000000..8b18887 --- /dev/null +++ b/MarsWater/MarsWater/CreateTaskTableViewController.m @@ -0,0 +1,146 @@ +// +// CreateTaskTableViewController.m +// MarsWater +// +// Created by Ayuna Vogel on 10/8/15. +// Copyright © 2015 Justine Gartner. All rights reserved. +// +#import + +#import "CreateTaskTableViewController.h" +#import "AppDelegate.h" +#import "Task.h" + +@interface CreateTaskTableViewController () + +@property (weak, nonatomic) IBOutlet UITextField *titleTextField; + +@property (nonatomic) Task *task; + + +@end + +@implementation CreateTaskTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self setupNavigationBar]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; + + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(void)setupNavigationBar{ + + self.navigationItem.title = @"Create New Task"; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; +} + +-(void)cancel{ + + [self dismissViewControllerAnimated:YES completion:nil]; +} + +-(void)save{ + + self.task.taskDescription = self.titleTextField.text; + self.task.createdAt = [NSDate date]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + [delegate.managedObjectContext save:nil]; + + [self dismissViewControllerAnimated:YES completion:nil]; + + NSLog(@"%@", self.task); +} + +- (IBAction)colorButtonTapped:(UIButton *)sender { + + self.task.color = sender.backgroundColor; + + +} + +//#pragma mark - Table view data source +// +//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +//#warning Incomplete implementation, return the number of sections +// return 1; +//} +// +//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +//#warning Incomplete implementation, return the number of rows +// return 0; +//} + +/* +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; + + // Configure the cell... + + return cell; +} +*/ + +/* +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the specified item to be editable. + return YES; +} +*/ + +/* +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } +} +*/ + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { +} +*/ + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents index fc42e46..b274f86 100644 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -7,6 +7,7 @@ + @@ -17,6 +18,6 @@ - + \ No newline at end of file diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.h b/MarsWater/MarsWater/Task+CoreDataProperties.h index 9d5fe52..b20fbc8 100644 --- a/MarsWater/MarsWater/Task+CoreDataProperties.h +++ b/MarsWater/MarsWater/Task+CoreDataProperties.h @@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nullable, nonatomic, retain) NSNumber *priority; @property (nullable, nonatomic, retain) NSDate *completedAt; @property (nullable, nonatomic, retain) NSManagedObject *list; +@property (nullable, nonatomic, retain) id color; @end diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.m b/MarsWater/MarsWater/Task+CoreDataProperties.m index 527f35b..293b0bc 100644 --- a/MarsWater/MarsWater/Task+CoreDataProperties.m +++ b/MarsWater/MarsWater/Task+CoreDataProperties.m @@ -20,5 +20,6 @@ @implementation Task (CoreDataProperties) @dynamic priority; @dynamic completedAt; @dynamic list; +@dynamic color; @end diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m index 030b801..5716ed6 100644 --- a/MarsWater/MarsWater/TasksTableViewController.m +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -7,8 +7,12 @@ // #import "TasksTableViewController.h" +#import "AppDelegate.h" +#import "Task.h" -@interface TasksTableViewController () +@interface TasksTableViewController () + +@property (nonatomic) NSFetchedResultsController *fetchedResultsController; @end @@ -17,6 +21,27 @@ @implementation TasksTableViewController - (void)viewDidLoad { [super viewDidLoad]; + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + //Create an instance of NSFetchRequest with an entity name + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Task"]; + + //create a sort descriptor + NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; + + //set the sort descriptors on the fetchRequest + fetchRequest.sortDescriptors = @[sort]; + + //create a fetchedResultsController with a fetchRequest and a managedObjectContext + self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + + self.fetchedResultsController.delegate = self; + + [self.fetchedResultsController performFetch:nil]; + + + self.navigationItem.title = @"Tasks"; + // Uncomment the following line to preserve selection between presentations. // self.clearsSelectionOnViewWillAppear = NO; @@ -32,24 +57,35 @@ - (void)didReceiveMemoryWarning { #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { -#warning Incomplete implementation, return the number of sections - return 0; + return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { -#warning Incomplete implementation, return the number of rows - return 0; + return self.fetchedResultsController.fetchedObjects.count; } -/* - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; - // Configure the cell... + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TaskCellIdentifier" forIndexPath:indexPath]; + + Task *task = self.fetchedResultsController.fetchedObjects[indexPath.row]; + + cell.textLabel.text = task.taskDescription; + +// NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; +// formatter.dateStyle = NSDateFormatterShortStyle; +// cell.detailTextLabel.text = [formatter stringFromDate:task.createdAt]; + + cell.backgroundColor = (UIColor *)task.color; return cell; } -*/ + +// NSFetchResultsController delegate method +-(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath{ + + [self.tableView reloadData]; +} /* // Override to support conditional editing of the table view. From 2a21b8e0693025727f6d8528b579eec6468061b7 Mon Sep 17 00:00:00 2001 From: ayunav Date: Thu, 8 Oct 2015 13:55:29 -0400 Subject: [PATCH 7/8] added methods for all the View controllers. The app doesn't work. App deleagate implementation methods don't work. Aborts, Error. --- MarsWater/.DS_Store | Bin 6148 -> 6148 bytes MarsWater/MarsWater/AppDelegate.m | 63 +++++---- .../MarsWater/Base.lproj/Main.storyboard | 2 +- .../MarsWater/CreateListTableViewController.m | 5 +- .../MarsWater/CreateTaskTableViewController.h | 3 + .../MarsWater/CreateTaskTableViewController.m | 52 ++++--- .../MarsWater/ListsTableViewController.m | 76 ++++++---- .../MarsWater/TasksTableViewController.h | 3 + .../MarsWater/TasksTableViewController.m | 132 +++++++++++------- 9 files changed, 196 insertions(+), 140 deletions(-) diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store index d1c4de07aa4a6321bbd3a20c5bbca3b7269f36ec..263fb6a9777da8b59890fab8cd4163753cc002da 100644 GIT binary patch delta 33 pcmZoMXffE}!pJ1nIk|yRXL1o^!{)Cd{LGsLnAn&%vvd6A2LQEr3NHWv delta 33 pcmZoMXffE}!pJ19IJtpQXL1o^17pBuMkY44i4A<4**X650|21030?pI diff --git a/MarsWater/MarsWater/AppDelegate.m b/MarsWater/MarsWater/AppDelegate.m index 153186b..63526ef 100644 --- a/MarsWater/MarsWater/AppDelegate.m +++ b/MarsWater/MarsWater/AppDelegate.m @@ -15,12 +15,45 @@ @interface AppDelegate () @implementation AppDelegate +# pragma mark - AppDelegate methods + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + // Saves changes in the application's managed object context before the application terminates. + [self saveContext]; +} + + #pragma mark - Core Data stack @synthesize managedObjectContext = _managedObjectContext; @synthesize managedObjectModel = _managedObjectModel; @synthesize persistentStoreCoordinator = _persistentStoreCoordinator; + - (NSURL *)applicationDocumentsDirectory { // The directory the application uses to store the Core Data store file (usually SQLite file). This code uses a directory named "nyc.c4q.justinekay.MarsWater" in the application's documents directory. return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; @@ -98,35 +131,5 @@ - (void)saveContext { } } -# pragma mark - AppDelegate methods - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - // Saves changes in the application's managed object context before the application terminates. - [self saveContext]; -} @end diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard index 4ae66d7..318217f 100644 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -37,7 +37,7 @@ - + diff --git a/MarsWater/MarsWater/CreateListTableViewController.m b/MarsWater/MarsWater/CreateListTableViewController.m index ea616c7..1b250f6 100644 --- a/MarsWater/MarsWater/CreateListTableViewController.m +++ b/MarsWater/MarsWater/CreateListTableViewController.m @@ -40,6 +40,10 @@ -(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)]; + + self.navigationItem.leftBarButtonItem.tintColor = [UIColor grayColor]; + self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:224.0/255.0 green:35.0/255.0 blue:70.0/255.0 alpha:1.0]; + } -(void)cancel{ @@ -64,7 +68,6 @@ - (IBAction)colorButtonTapped:(UIButton *)sender { self.list.color = sender.backgroundColor; - } @end diff --git a/MarsWater/MarsWater/CreateTaskTableViewController.h b/MarsWater/MarsWater/CreateTaskTableViewController.h index aaaca9f..24d3b49 100644 --- a/MarsWater/MarsWater/CreateTaskTableViewController.h +++ b/MarsWater/MarsWater/CreateTaskTableViewController.h @@ -7,7 +7,10 @@ // #import +#import "List.h" @interface CreateTaskTableViewController : UITableViewController +@property (nonatomic) List *list; + @end diff --git a/MarsWater/MarsWater/CreateTaskTableViewController.m b/MarsWater/MarsWater/CreateTaskTableViewController.m index 8b18887..18f1307 100644 --- a/MarsWater/MarsWater/CreateTaskTableViewController.m +++ b/MarsWater/MarsWater/CreateTaskTableViewController.m @@ -17,6 +17,8 @@ @interface CreateTaskTableViewController () @property (nonatomic) Task *task; +@property (nonatomic) NSMutableOrderedSet *tasksInList; + @end @@ -25,6 +27,8 @@ @implementation CreateTaskTableViewController - (void)viewDidLoad { [super viewDidLoad]; + self.tasksInList = self.list.task.mutableCopy; + [self setupNavigationBar]; AppDelegate *delegate = [UIApplication sharedApplication].delegate; @@ -32,16 +36,12 @@ - (void)viewDidLoad { self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; - // Uncomment the following line to preserve selection between presentations. - // self.clearsSelectionOnViewWillAppear = NO; - // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. } -(void)setupNavigationBar{ @@ -50,6 +50,10 @@ -(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)]; + + self.navigationItem.leftBarButtonItem.tintColor = [UIColor grayColor]; + self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:224.0/255.0 green:35.0/255.0 blue:70.0/255.0 alpha:1.0]; + } -(void)cancel{ @@ -60,10 +64,25 @@ -(void)cancel{ -(void)save{ self.task.taskDescription = self.titleTextField.text; - self.task.createdAt = [NSDate date]; + + if (self.task.createdAt == nil) { + + self.task.createdAt = [NSDate date]; + + }else { + + self.task.updatedAt = [NSDate date]; + } + + + //update tasksInList (NSOrderedSet) + + self.list.task = self.tasksInList; + + //save to task to core data context AppDelegate *delegate = [UIApplication sharedApplication].delegate; - [delegate.managedObjectContext save:nil]; + [delegate.managedObjectContext save:nil]; // nil = No Error, Save with no NSError parameter [self dismissViewControllerAnimated:YES completion:nil]; @@ -74,30 +93,9 @@ - (IBAction)colorButtonTapped:(UIButton *)sender { self.task.color = sender.backgroundColor; - } -//#pragma mark - Table view data source -// -//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { -//#warning Incomplete implementation, return the number of sections -// return 1; -//} -// -//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { -//#warning Incomplete implementation, return the number of rows -// return 0; -//} -/* -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; - - // Configure the cell... - - return cell; -} -*/ /* // Override to support conditional editing of the table view. diff --git a/MarsWater/MarsWater/ListsTableViewController.m b/MarsWater/MarsWater/ListsTableViewController.m index e23a614..6210b2c 100644 --- a/MarsWater/MarsWater/ListsTableViewController.m +++ b/MarsWater/MarsWater/ListsTableViewController.m @@ -11,6 +11,7 @@ #import "ListsTableViewController.h" #import "AppDelegate.h" #import "List.h" +#import "TasksTableViewController.h" @interface ListsTableViewController () @@ -65,45 +66,69 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.textLabel.text = list.title; - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; formatter.dateStyle = NSDateFormatterShortStyle; cell.detailTextLabel.text = [formatter stringFromDate:list.createdAt]; - - - cell.backgroundColor = (UIColor *)list.color; return cell; } +-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ + + return YES; +} + +-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (editingStyle == UITableViewCellEditingStyleDelete) { + + List *selectedList = self.fetchedResultsController.fetchedObjects[indexPath.row]; + [self removeObjectFromCoreDataContext:selectedList]; + + } + +} + +#pragma mark - Core Data + +-(void)removeObjectFromCoreDataContext:(List *)selectedList { + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + NSManagedObjectContext *context = delegate.managedObjectContext; + [context deleteObject:selectedList]; + [context processPendingChanges]; + +} + + // NSFetchResultsController delegate method -(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath{ [self.tableView reloadData]; } -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the specified item to be editable. - return YES; -} -*/ +#pragma mark - Navigation -/* -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { - if (editingStyle == UITableViewCellEditingStyleDelete) { - // Delete the row from the data source - [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; - } else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if ([segue.identifier isEqualToString:@"TasksSegue"]){ + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + TasksTableViewController *tasksTVC = segue.destinationViewController; + + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + + tasksTVC.list = list; + + NSLog(@"taskTVC.list: %@", tasksTVC.list); + } + } -*/ + /* // Override to support rearranging the table view. @@ -119,14 +144,5 @@ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *) } */ -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ @end diff --git a/MarsWater/MarsWater/TasksTableViewController.h b/MarsWater/MarsWater/TasksTableViewController.h index 140c467..cac577c 100644 --- a/MarsWater/MarsWater/TasksTableViewController.h +++ b/MarsWater/MarsWater/TasksTableViewController.h @@ -7,7 +7,10 @@ // #import +#import "List.h" @interface TasksTableViewController : UITableViewController +@property (nonatomic) List *list; + @end diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m index 5716ed6..4933357 100644 --- a/MarsWater/MarsWater/TasksTableViewController.m +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -9,10 +9,11 @@ #import "TasksTableViewController.h" #import "AppDelegate.h" #import "Task.h" +#import "CreateTaskTableViewController.h" @interface TasksTableViewController () -@property (nonatomic) NSFetchedResultsController *fetchedResultsController; +@property (nonatomic) NSMutableOrderedSet *tasksList; @end @@ -20,35 +21,47 @@ @implementation TasksTableViewController - (void)viewDidLoad { [super viewDidLoad]; + + //self.navigationItem.title = @"Tasks"; + self.navigationItem.title = self.list.title; - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - - //Create an instance of NSFetchRequest with an entity name - NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Task"]; - - //create a sort descriptor - NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; - - //set the sort descriptors on the fetchRequest - fetchRequest.sortDescriptors = @[sort]; - - //create a fetchedResultsController with a fetchRequest and a managedObjectContext - self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; - - self.fetchedResultsController.delegate = self; - - [self.fetchedResultsController performFetch:nil]; + [self.tableView reloadData]; + self.tableView.backgroundColor = self.list.color; + self.tableView.backgroundView.backgroundColor = self.list.color; + - self.navigationItem.title = @"Tasks"; - // Uncomment the following line to preserve selection between presentations. - // self.clearsSelectionOnViewWillAppear = NO; +// AppDelegate *delegate = [UIApplication sharedApplication].delegate; +// +// //Create an instance of NSFetchRequest with an entity name +// NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Task"]; +// +// //create a sort descriptor +// NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; +// +// //set the sort descriptors on the fetchRequest +// fetchRequest.sortDescriptors = @[sort]; +// +// //create a fetchedResultsController with a fetchRequest and a managedObjectContext +// self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; +// +// self.fetchedResultsController.delegate = self; +// +// [self.fetchedResultsController performFetch:nil]; +// + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; } +-(void)viewDidAppear:(BOOL)animated{ + + [self.tableView reloadData]; +} + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. @@ -61,24 +74,26 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.fetchedResultsController.fetchedObjects.count; + return self.list.task.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TaskCellIdentifier" forIndexPath:indexPath]; - Task *task = self.fetchedResultsController.fetchedObjects[indexPath.row]; + Task *task = self.list.task[indexPath.row]; cell.textLabel.text = task.taskDescription; - -// NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; -// formatter.dateStyle = NSDateFormatterShortStyle; -// cell.detailTextLabel.text = [formatter stringFromDate:task.createdAt]; - - cell.backgroundColor = (UIColor *)task.color; + cell.backgroundColor = self.list.color; return cell; + //Task *task = self.fetchedResultsController.fetchedObjects[indexPath.row]; + //cell.textLabel.text = task.taskDescription; + //cell.backgroundColor = (UIColor *)task.color; + + // NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + // formatter.dateStyle = NSDateFormatterShortStyle; + // cell.detailTextLabel.text = [formatter stringFromDate:task.createdAt]; } // NSFetchResultsController delegate method @@ -87,25 +102,49 @@ -(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)a [self.tableView reloadData]; } -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the specified item to be editable. +-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ + return YES; } -*/ -/* -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + +-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ + if (editingStyle == UITableViewCellEditingStyleDelete) { - // Delete the row from the data source + + Task *selectedTask = self.list.task[indexPath.row]; + [self removeObjectFromCoreDataContext:selectedTask]; + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; - } else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } + + } + } -*/ + + +#pragma mark - Core Data method + +-(void)removeObjectFromCoreDataContext:(Task *)selectedTask { + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + NSManagedObjectContext *context = delegate.managedObjectContext; + [context deleteObject:selectedTask]; + [context processPendingChanges]; + +} + + +#pragma mark - Navigation + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ + + UINavigationController *navController = segue.destinationViewController; + + CreateTaskTableViewController *createTaskTVC = (CreateTaskTableViewController *)([navController viewControllers][0]); + createTaskTVC.list = self.list; +} + + /* // Override to support rearranging the table view. @@ -121,14 +160,5 @@ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *) } */ -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ @end From 458b16d2cbd5f981fe1937fc9fa643d854f87acd Mon Sep 17 00:00:00 2001 From: ayunav Date: Fri, 9 Oct 2015 12:27:55 -0400 Subject: [PATCH 8/8] tasks display in the corresponding list. Added methods for correct display if no color was chosen when creating a list or a task. --- MarsWater/.DS_Store | Bin 6148 -> 6148 bytes MarsWater/MarsWater.xcodeproj/project.pbxproj | 12 ++++++-- .../MarsWater/CreateListTableViewController.m | 24 ++++++++------- .../MarsWater/CreateTaskTableViewController.m | 29 +++++++++--------- .../MarsWater/ListsTableViewController.m | 6 +++- .../MarsWater/TasksTableViewController.h | 1 + .../MarsWater/TasksTableViewController.m | 7 ++++- 7 files changed, 48 insertions(+), 31 deletions(-) diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store index 263fb6a9777da8b59890fab8cd4163753cc002da..6def41f4b3576fa200459f01ed9c17e773cc1964 100644 GIT binary patch delta 67 zcmZoMXffE}!pJ0hWO4(e4v&jVN@+E%X%+B$b9{{I}64w9# delta 62 zcmZoMXffE}!pJ1nIk|yRhsVVwrL-iOf#H&k;;G4Xj228_N{6E$!!S5GKeu4>dl6CQ P%>qnp%$wOc{_+C=XnhlI diff --git a/MarsWater/MarsWater.xcodeproj/project.pbxproj b/MarsWater/MarsWater.xcodeproj/project.pbxproj index 7c063b4..0fa5ee0 100644 --- a/MarsWater/MarsWater.xcodeproj/project.pbxproj +++ b/MarsWater/MarsWater.xcodeproj/project.pbxproj @@ -156,7 +156,7 @@ TargetAttributes = { 6B80EDD31BC1AE4300283EB5 = { CreatedOnToolsVersion = 7.0; - DevelopmentTeam = BA3X38Y2VZ; + DevelopmentTeam = N48NM3R37Q; }; }; }; @@ -316,10 +316,13 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = MarsWater/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = nyc.c4q.justinekay.MarsWater; + PRODUCT_BUNDLE_IDENTIFIER = com.ayunavogel.MarsWater; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Debug; }; @@ -327,10 +330,13 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = MarsWater/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = nyc.c4q.justinekay.MarsWater; + PRODUCT_BUNDLE_IDENTIFIER = com.ayunavogel.MarsWater; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Release; }; diff --git a/MarsWater/MarsWater/CreateListTableViewController.m b/MarsWater/MarsWater/CreateListTableViewController.m index 1b250f6..23100c6 100644 --- a/MarsWater/MarsWater/CreateListTableViewController.m +++ b/MarsWater/MarsWater/CreateListTableViewController.m @@ -15,7 +15,6 @@ @interface CreateListTableViewController () @property (weak, nonatomic) IBOutlet UITextField *titleTextField; - @property (nonatomic)List *list; @end @@ -23,15 +22,14 @@ @interface CreateListTableViewController () @implementation CreateListTableViewController -(void)viewDidLoad{ - [super viewDidLoad]; - [self setupNavigationBar]; AppDelegate *delegate = [UIApplication sharedApplication].delegate; - self.list = [NSEntityDescription insertNewObjectForEntityForName:@"List" inManagedObjectContext:delegate.managedObjectContext]; + + [self setupNavigationBar]; } -(void)setupNavigationBar{ @@ -51,23 +49,27 @@ -(void)cancel{ [self dismissViewControllerAnimated:YES completion:nil]; } +- (IBAction)colorButtonTapped:(UIButton *)sender { + + self.list.color = sender.backgroundColor; + sender.alpha = 0.3; +} + -(void)save{ + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + // set task's properties + self.list.title = self.titleTextField.text; self.list.createdAt = [NSDate date]; - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - [delegate.managedObjectContext save:nil]; + [delegate.managedObjectContext save:nil]; // saves task's properties to the core data context, incl. color method that is outside of this method, because appdelegate and entity were initiated in the viewDidLoad method [self dismissViewControllerAnimated:YES completion:nil]; NSLog(@"%@", self.list); } -- (IBAction)colorButtonTapped:(UIButton *)sender { - - self.list.color = sender.backgroundColor; - -} @end diff --git a/MarsWater/MarsWater/CreateTaskTableViewController.m b/MarsWater/MarsWater/CreateTaskTableViewController.m index 18f1307..3ee3b59 100644 --- a/MarsWater/MarsWater/CreateTaskTableViewController.m +++ b/MarsWater/MarsWater/CreateTaskTableViewController.m @@ -27,14 +27,14 @@ @implementation CreateTaskTableViewController - (void)viewDidLoad { [super viewDidLoad]; - self.tasksInList = self.list.task.mutableCopy; - - [self setupNavigationBar]; - AppDelegate *delegate = [UIApplication sharedApplication].delegate; self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; + [self setupNavigationBar]; + + self.tasksInList = self.list.task.mutableCopy; + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; @@ -61,8 +61,17 @@ -(void)cancel{ [self dismissViewControllerAnimated:YES completion:nil]; } +- (IBAction)colorButtonTapped:(UIButton *)sender { + + self.task.color = sender.backgroundColor; + sender.alpha = 0.3; +} + + -(void)save{ + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + self.task.taskDescription = self.titleTextField.text; if (self.task.createdAt == nil) { @@ -75,13 +84,8 @@ -(void)save{ } - //update tasksInList (NSOrderedSet) + self.task.list = self.list; - self.list.task = self.tasksInList; - - //save to task to core data context - - AppDelegate *delegate = [UIApplication sharedApplication].delegate; [delegate.managedObjectContext save:nil]; // nil = No Error, Save with no NSError parameter [self dismissViewControllerAnimated:YES completion:nil]; @@ -89,11 +93,6 @@ -(void)save{ NSLog(@"%@", self.task); } -- (IBAction)colorButtonTapped:(UIButton *)sender { - - self.task.color = sender.backgroundColor; - -} diff --git a/MarsWater/MarsWater/ListsTableViewController.m b/MarsWater/MarsWater/ListsTableViewController.m index 6210b2c..676419a 100644 --- a/MarsWater/MarsWater/ListsTableViewController.m +++ b/MarsWater/MarsWater/ListsTableViewController.m @@ -71,7 +71,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.detailTextLabel.text = [formatter stringFromDate:list.createdAt]; - cell.backgroundColor = (UIColor *)list.color; + if (!list.color) { + cell.backgroundColor = [UIColor whiteColor]; + } else { + cell.backgroundColor = (UIColor *)list.color; + } return cell; } diff --git a/MarsWater/MarsWater/TasksTableViewController.h b/MarsWater/MarsWater/TasksTableViewController.h index cac577c..92b1631 100644 --- a/MarsWater/MarsWater/TasksTableViewController.h +++ b/MarsWater/MarsWater/TasksTableViewController.h @@ -11,6 +11,7 @@ @interface TasksTableViewController : UITableViewController +@property (nonatomic) Task *task; @property (nonatomic) List *list; @end diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m index 4933357..b76851f 100644 --- a/MarsWater/MarsWater/TasksTableViewController.m +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -84,7 +84,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N Task *task = self.list.task[indexPath.row]; cell.textLabel.text = task.taskDescription; - cell.backgroundColor = self.list.color; + self.tableView.backgroundColor = self.list.color; + if (!task.color) { + cell.backgroundColor = [UIColor whiteColor]; + } else { + cell.backgroundColor = task.color; + } return cell; //Task *task = self.fetchedResultsController.fetchedObjects[indexPath.row];