From be4e134797bb6f7e8c860d7e10764fdf4c7217b2 Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Mon, 3 Dec 2012 02:25:37 +0100 Subject: [PATCH] Disabling swipe-to-delete while adding a list or a task --- Classes/CDIListsViewController.m | 2 +- Classes/CDITasksViewController.m | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Classes/CDIListsViewController.m b/Classes/CDIListsViewController.m index d36ab92..043b055 100644 --- a/Classes/CDIListsViewController.m +++ b/Classes/CDIListsViewController.m @@ -435,7 +435,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N } - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - if (_adding && indexPath.row == 0) { + if (_adding) { return NO; } diff --git a/Classes/CDITasksViewController.m b/Classes/CDITasksViewController.m index ffcf37c..31d9578 100644 --- a/Classes/CDITasksViewController.m +++ b/Classes/CDITasksViewController.m @@ -373,6 +373,13 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger return self.addTaskView; } +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + if (self.coverView.alpha == 1.0f) { + return NO; + } + + return YES; +} #pragma mark - UITableViewDelegate