diff options
Diffstat (limited to 'iBean')
-rw-r--r-- | iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate | bin | 30346 -> 30580 bytes | |||
-rw-r--r-- | iBean/iBean/BeanCollectionListViewController.h | 4 | ||||
-rw-r--r-- | iBean/iBean/BeanCollectionListViewController.m | 12 | ||||
-rw-r--r-- | iBean/iBean/iPhoneStoryboard.storyboard | 8 |
4 files changed, 17 insertions, 7 deletions
diff --git a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate Binary files differindex f937bb9..b147436 100644 --- a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate +++ b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/iBean/iBean/BeanCollectionListViewController.h b/iBean/iBean/BeanCollectionListViewController.h index 5ac810d..648216b 100644 --- a/iBean/iBean/BeanCollectionListViewController.h +++ b/iBean/iBean/BeanCollectionListViewController.h @@ -12,14 +12,16 @@ @property (nonatomic, strong) NSArray *beanCollections; @property (nonatomic, strong) BeanCollection *beanCollection; +@property (nonatomic, strong) UIBarButtonItem *beanCollectionsListEditDoneButton; /* Utility methods */ - (void) initViewController; /* UI Outlets */ +@property (strong, nonatomic) IBOutlet UIBarButtonItem *beanCollectionsListEditButton; /* UI Actions */ -- (IBAction) editButtonPressed: (id)sender; +- (IBAction) toggleEditMode: (id)sender; @end diff --git a/iBean/iBean/BeanCollectionListViewController.m b/iBean/iBean/BeanCollectionListViewController.m index c7adf33..4432fe5 100644 --- a/iBean/iBean/BeanCollectionListViewController.m +++ b/iBean/iBean/BeanCollectionListViewController.m @@ -169,6 +169,9 @@ { NSLog(@"BeanCollectionListViewController - initViewController"); + //Allocate edit's done button + self.beanCollectionsListEditDoneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(toggleEditMode:)]; + //Remove "new" bean collection if it is allocated if (self.beanCollection != nil) { @@ -192,13 +195,14 @@ *****************************************************/ #pragma mark - IBActions -- (void) editButtonPressed: (id)sender +- (void) toggleEditMode:(id)sender { if (self.editing) - NSLog(@"Disabling editing mode!"); + self.navigationItem.leftBarButtonItem = self.beanCollectionsListEditButton; else - NSLog(@"Enabling editing mode!"); - self.editing = !self.editing; + self.navigationItem.leftBarButtonItem = self.beanCollectionsListEditDoneButton; + + [self setEditing:!self.editing animated:YES]; } @end diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard index c9fd722..5fc65b8 100644 --- a/iBean/iBean/iPhoneStoryboard.storyboard +++ b/iBean/iBean/iPhoneStoryboard.storyboard @@ -39,7 +39,7 @@ <navigationItem key="navigationItem" title="iBean" id="kps-mZ-pxP"> <barButtonItem key="leftBarButtonItem" systemItem="edit" id="lNm-m6-tWK"> <connections> - <action selector="editButtonPressed:" destination="agK-tm-pZO" id="V8U-4t-IMx"/> + <action selector="toggleEditMode:" destination="agK-tm-pZO" id="lfY-BG-5iE"/> </connections> </barButtonItem> <barButtonItem key="rightBarButtonItem" systemItem="add" id="Wuc-np-Bjz"> @@ -48,6 +48,9 @@ </connections> </barButtonItem> </navigationItem> + <connections> + <outlet property="beanCollectionsListEditButton" destination="lNm-m6-tWK" id="BWn-Ra-QyB"/> + </connections> </tableViewController> <placeholder placeholderIdentifier="IBFirstResponder" id="BXw-pd-TpS" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> @@ -490,7 +493,8 @@ <class className="BeanCollectionListViewController" superclassName="UITableViewController"> <source key="sourceIdentifier" type="project" relativePath="./Classes/BeanCollectionListViewController.h"/> <relationships> - <relationship kind="action" name="editButtonPressed:"/> + <relationship kind="action" name="toggleEditMode:"/> + <relationship kind="outlet" name="beanCollectionsListEditButton" candidateClass="UIBarButtonItem"/> </relationships> </class> <class className="InstaBeanViewController" superclassName="UIViewController"> |