diff options
author | Eddie Ehlin <eddiex@eddiex.se> | 2013-01-12 22:40:07 +0100 |
---|---|---|
committer | Eddie Ehlin <eddiex@eddiex.se> | 2013-01-12 22:40:07 +0100 |
commit | c8549ce4b0f874a597f1f7edf820cd1dd1b1f9f0 (patch) | |
tree | f3f08328e44a7635a2eea76b38ad2e0be9eda546 /iBean | |
parent | e392de36b36ee670474480af6ec895d917f3f322 (diff) | |
download | iBean-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.
Diffstat (limited to 'iBean')
-rw-r--r-- | iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate | bin | 33713 -> 32990 bytes | |||
-rw-r--r-- | iBean/iBean/AddBeanViewController.m | 12 | ||||
-rw-r--r-- | iBean/iBean/iPhoneStoryboard.storyboard | 4 |
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 Binary files differindex 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 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> |