aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Ehlin <eddiex@eddiex.se>2013-01-12 22:40:07 +0100
committerEddie Ehlin <eddiex@eddiex.se>2013-01-12 22:40:07 +0100
commitc8549ce4b0f874a597f1f7edf820cd1dd1b1f9f0 (patch)
treef3f08328e44a7635a2eea76b38ad2e0be9eda546
parente392de36b36ee670474480af6ec895d917f3f322 (diff)
downloadiBean-c8549ce4b0f874a597f1f7edf820cd1dd1b1f9f0.tar.gz
iBean-c8549ce4b0f874a597f1f7edf820cd1dd1b1f9f0.zip
When adding a new bean it will (if possible) pre set the grinder setting from last added bean to the collection.
-rw-r--r--iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstatebin33713 -> 32990 bytes
-rw-r--r--iBean/iBean/AddBeanViewController.m12
-rw-r--r--iBean/iBean/iPhoneStoryboard.storyboard4
3 files changed, 14 insertions, 2 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 d0691ef..9208585 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/AddBeanViewController.m b/iBean/iBean/AddBeanViewController.m
index be5cc8e..553bc93 100644
--- a/iBean/iBean/AddBeanViewController.m
+++ b/iBean/iBean/AddBeanViewController.m
@@ -51,6 +51,18 @@
{
NSLog(@"AddBeanViewController - initViewController");
+ //If there exists beans in collection, then pre set the
+ //grinder setting to the value of latest added bean.
+ if (self.beanCollection != nil)
+ {
+ if (self.beanCollection.beans.count > 0)
+ {
+ NSNumber *grinderSetting = ((Bean*)[self.beanCollection.beans lastObject]).grindSetting;
+ self.grinderSettingLabel.text = [NSString stringWithFormat:@"%1.0f", [grinderSetting doubleValue]];
+ self.grinderSettingStepper.value = [grinderSetting doubleValue];
+ }
+ }
+
if (self.editMode == YES)
{
//TODO: Update UI to refelect edit mode.
diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard
index 03f46e5..153d02f 100644
--- a/iBean/iBean/iPhoneStoryboard.storyboard
+++ b/iBean/iBean/iPhoneStoryboard.storyboard
@@ -392,7 +392,7 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
- <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="0.0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nPM-k1-zYG">
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nPM-k1-zYG">
<constraints>
<constraint firstAttribute="width" constant="29" id="qX5-Yz-NSx"/>
</constraints>
@@ -548,7 +548,7 @@
<action selector="grinderSettingStepperChanged:" destination="YXO-0S-PzZ" eventType="valueChanged" id="f0Q-WO-wvI"/>
</connections>
</stepper>
- <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="0.0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hHL-o2-clY">
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hHL-o2-clY">
<constraints>
<constraint firstAttribute="width" constant="29" id="7IX-JY-Sim"/>
</constraints>