From e16b75a3ff640188fe6ea980355f7ea4491e2629 Mon Sep 17 00:00:00 2001 From: Eddie Ehlin Date: Sun, 17 Feb 2013 14:31:15 +0100 Subject: Moved edit support to BeanCollectionListViewController and now editing enables user to delete/edit existing bean collection. Previous Edit button in the bean collection extraction view will be replaced by an extraction button which results in a popover dialog containing the timer. --- .../UserInterfaceState.xcuserstate | Bin 48738 -> 49744 bytes .../iBean/BeanCollectionExtractionViewController.m | 10 ---------- iBean/iBean/BeanCollectionListViewController.m | 18 ++++++++++++++++++ iBean/iBean/iPhoneStoryboard.storyboard | 19 +++++++------------ 4 files changed, 25 insertions(+), 22 deletions(-) (limited to 'iBean') diff --git a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate index dd74adc..f76b034 100644 Binary files a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate and b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iBean/iBean/BeanCollectionExtractionViewController.m b/iBean/iBean/BeanCollectionExtractionViewController.m index 6f620fd..7eeb574 100644 --- a/iBean/iBean/BeanCollectionExtractionViewController.m +++ b/iBean/iBean/BeanCollectionExtractionViewController.m @@ -7,7 +7,6 @@ // #import #import "BeanCollectionExtractionViewController.h" -#import "BeanCollectionInfoViewController.h" #import "BeanCollection+Interface.h" #import "BeanCell.h" #import "Bean+Interface.h" @@ -56,15 +55,6 @@ // Dispose of any resources that can be recreated. } -- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender -{ - if ([segue.identifier isEqualToString:@"EditBeanCollectionSegue"]) - { - BeanCollectionInfoViewController *infoViewController = (BeanCollectionInfoViewController *)[[segue.destinationViewController viewControllers] objectAtIndex:0]; - [infoViewController initWithModeAndBeanCollection:YES :self.beanCollection]; - } -} - /***************************************************** Utility methods *****************************************************/ diff --git a/iBean/iBean/BeanCollectionListViewController.m b/iBean/iBean/BeanCollectionListViewController.m index 3f84aed..bd98f89 100644 --- a/iBean/iBean/BeanCollectionListViewController.m +++ b/iBean/iBean/BeanCollectionListViewController.m @@ -65,6 +65,11 @@ self.beanCollection = [self.beanCollections objectAtIndex:[self.tableView indexPathForSelectedRow].row]; [extractionViewController initWithBeanCollection: self.beanCollection]; } + else if ([segue.identifier isEqualToString:@"EditBeanCollectionSegue"]) + { + BeanCollectionInfoViewController *infoViewController = (BeanCollectionInfoViewController *)[[segue.destinationViewController viewControllers] objectAtIndex:0]; + [infoViewController initWithModeAndBeanCollection:YES :[self.beanCollections objectAtIndex: [self.tableView indexPathForSelectedRow].row]]; + } } - (void)didReceiveMemoryWarning @@ -145,6 +150,19 @@ #pragma mark - Table view delegate +- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + //If we're in edit mode then we should go to edit bean collection, else extraction view. + if (tableView.editing == YES) + { + [self performSegueWithIdentifier:@"EditBeanCollectionSegue" sender:self]; + } + else + { + [self performSegueWithIdentifier:@"BeanCollectionListBeanCollectionExtractionSegue" sender:self]; + } +} + /***************************************************** Utility methods *****************************************************/ diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard index 2f77028..c23e3fc 100644 --- a/iBean/iBean/iPhoneStoryboard.storyboard +++ b/iBean/iBean/iPhoneStoryboard.storyboard @@ -8,12 +8,12 @@ - + - + @@ -28,9 +28,6 @@ - - - @@ -53,6 +50,8 @@ + + @@ -1225,11 +1224,7 @@ - - - - - + @@ -1419,8 +1414,8 @@ - - + + \ No newline at end of file -- cgit v1.2.3