aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Ehlin <eddiex@eddiex.se>2013-02-17 14:31:15 +0100
committerEddie Ehlin <eddiex@eddiex.se>2013-02-17 14:31:15 +0100
commite16b75a3ff640188fe6ea980355f7ea4491e2629 (patch)
tree14d9c77d906e6263e7f229f99d299083101e550a
parent01e9e1dae8784202be7ec683d3f34d00c112eee1 (diff)
downloadiBean-e16b75a3ff640188fe6ea980355f7ea4491e2629.tar.gz
iBean-e16b75a3ff640188fe6ea980355f7ea4491e2629.zip
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.
-rw-r--r--iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstatebin48738 -> 49744 bytes
-rw-r--r--iBean/iBean/BeanCollectionExtractionViewController.m10
-rw-r--r--iBean/iBean/BeanCollectionListViewController.m18
-rw-r--r--iBean/iBean/iPhoneStoryboard.storyboard19
4 files changed, 25 insertions, 22 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
index dd74adc..f76b034 100644
--- a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate
+++ b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate
Binary files 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 <AudioToolbox/AudioToolbox.h>
#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 @@
<scene sceneID="SSu-AL-Mw5">
<objects>
<tableViewController id="agK-tm-pZO" customClass="BeanCollectionListViewController" sceneMemberID="viewController">
- <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Mma-e7-grn">
+ <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" allowsSelectionDuringEditing="YES" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Mma-e7-grn">
<rect key="frame" x="0.0" y="64" width="320" height="455"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
- <tableViewCell contentMode="scaleToFill" selectionStyle="gray" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="BeanCollectionCell" textLabel="5Nr-tS-3gE" style="IBUITableViewCellStyleDefault" id="aBV-gH-ENe">
+ <tableViewCell contentMode="scaleToFill" selectionStyle="gray" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="BeanCollectionCell" editingAccessoryType="disclosureIndicator" textLabel="5Nr-tS-3gE" style="IBUITableViewCellStyleDefault" id="aBV-gH-ENe">
<rect key="frame" x="0.0" y="22" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
@@ -28,9 +28,6 @@
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
- <connections>
- <segue destination="aA5-tc-vwr" kind="push" identifier="BeanCollectionListBeanCollectionExtractionSegue" id="QRH-Pr-UBY"/>
- </connections>
</tableViewCell>
</prototypes>
<sections/>
@@ -53,6 +50,8 @@
</navigationItem>
<connections>
<outlet property="beanCollectionsListEditButton" destination="lNm-m6-tWK" id="BWn-Ra-QyB"/>
+ <segue destination="ryM-Nv-nnd" kind="modal" identifier="EditBeanCollectionSegue" id="8Kh-dv-G2O"/>
+ <segue destination="aA5-tc-vwr" kind="push" identifier="BeanCollectionListBeanCollectionExtractionSegue" id="drl-XN-Uii"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="BXw-pd-TpS" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -1225,11 +1224,7 @@
</constraints>
</view>
<navigationItem key="navigationItem" id="nKM-NZ-clm">
- <barButtonItem key="rightBarButtonItem" systemItem="edit" id="ikw-nF-0l3">
- <connections>
- <segue destination="ryM-Nv-nnd" kind="modal" identifier="EditBeanCollectionSegue" id="utz-eo-nc3"/>
- </connections>
- </barButtonItem>
+ <barButtonItem key="rightBarButtonItem" title="Extract!" id="ikw-nF-0l3"/>
</navigationItem>
<connections>
<outlet property="beanCollectionNoteTextView" destination="WyC-9J-FOJ" id="ajj-RC-E9O"/>
@@ -1419,8 +1414,8 @@
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
- <segue reference="qk2-F5-M1s"/>
<segue reference="OPZ-Pj-2Dz"/>
- <segue reference="utz-eo-nc3"/>
+ <segue reference="8Kh-dv-G2O"/>
+ <segue reference="qk2-F5-M1s"/>
</inferredMetricsTieBreakers>
</document> \ No newline at end of file