diff options
Diffstat (limited to 'iBean')
-rw-r--r-- | iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate | bin | 58590 -> 58038 bytes | |||
-rw-r--r-- | iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist | 6 | ||||
-rw-r--r-- | iBean/iBean/InstantExtractionViewController.h | 4 | ||||
-rw-r--r-- | iBean/iBean/InstantExtractionViewController.m | 63 | ||||
-rw-r--r-- | iBean/iBean/iPadStoryboard.storyboard | 46 | ||||
-rw-r--r-- | iBean/iBean/iPhoneStoryboard.storyboard | 39 |
6 files changed, 153 insertions, 5 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 4fcc5fd..a4aeb08 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.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist index 1b45798..8003b60 100644 --- a/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ b/iBean/iBean.xcodeproj/xcuserdata/eddiex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -8,11 +8,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "iBean/InstantExtractionViewController.m" - timestampString = "385133878.06268" + timestampString = "385501866.06976" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "91" - endingLineNumber = "91" + startingLineNumber = "97" + endingLineNumber = "97" landmarkName = "-haltExtractionTimer" landmarkType = "5"> </FileBreakpoint> diff --git a/iBean/iBean/InstantExtractionViewController.h b/iBean/iBean/InstantExtractionViewController.h index c6a1c78..d982ffb 100644 --- a/iBean/iBean/InstantExtractionViewController.h +++ b/iBean/iBean/InstantExtractionViewController.h @@ -8,10 +8,11 @@ #import <UIKit/UIKit.h> -@interface InstantExtractionViewController : UIViewController <UIAlertViewDelegate> +@interface InstantExtractionViewController : UIViewController <UIAlertViewDelegate, UITableViewDataSource, UITableViewDelegate> @property (nonatomic, assign) double extractionProgress; @property (nonatomic, assign) BOOL extractionInProgress; +@property (nonatomic, strong) NSMutableArray *extractionTimes; /* Utility methods */ - (void) initViewController; @@ -25,6 +26,7 @@ @property (weak, nonatomic) IBOutlet UIStepper *extractionSettingStepper; @property (weak, nonatomic) IBOutlet UILabel *extractionProgressLabel; @property (weak, nonatomic) IBOutlet UILabel *extractionStateLabel; +@property (weak, nonatomic) IBOutlet UITableView *extractionTimesTableView; /* UI Actions */ - (IBAction)startExtraction:(id)sender; diff --git a/iBean/iBean/InstantExtractionViewController.m b/iBean/iBean/InstantExtractionViewController.m index 825d7ec..2b4c386 100644 --- a/iBean/iBean/InstantExtractionViewController.m +++ b/iBean/iBean/InstantExtractionViewController.m @@ -60,6 +60,12 @@ NSNumber* extractionTimerSetting = [(AppDelegate*) [[UIApplication sharedApplication] delegate] getInstantExtractionTimer]; [self.extractionSettingStepper setValue: extractionTimerSetting != nil ? [extractionTimerSetting doubleValue] : 0.0f]; [self updateExtractionSettingLabel]; + + //Allocate and init the array holding extraction times (in memory). + if (self.extractionTimes == nil) + { + self.extractionTimes = [[NSMutableArray alloc] init]; + } } - (void) updateExtractionProgressLabel @@ -96,6 +102,10 @@ - (void) timerInterrupted { + //Add extraction time to our array of extraction times (datasource for tableview) + [self.extractionTimes insertObject:[NSString stringWithString:self.extractionProgressLabel.text] atIndex:0]; + [self.extractionTimesTableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic]; + //Return UI to "Start extraction" state. [self.extractionStateLabel setText:@"Press to start"]; [self.extractionSettingStepper setEnabled:YES]; @@ -138,4 +148,57 @@ { [(AppDelegate*) [[UIApplication sharedApplication] delegate] incrementExtractionCount]; } + +#pragma mark - UITableView datasource & delegate +- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return self.extractionTimes.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"ExtractionTimeCell"; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; + + //Configure the cell and set its title + cell.textLabel.text = [NSString stringWithFormat:@"%@ s", [self.extractionTimes objectAtIndex:indexPath.row]]; + cell.detailTextLabel.text = @""; + return cell; +} + +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath +{ + // Return NO if you do not want the specified item to be editable (we want to be able to REMOVE though). + return YES; +} + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + if (self.extractionTimes != nil) + { + [self.extractionTimes removeObjectAtIndex: indexPath.row]; + } + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } + else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } +} + +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + // Return NO if you do not want the item to be re-orderable. + return NO; +} + @end diff --git a/iBean/iBean/iPadStoryboard.storyboard b/iBean/iBean/iPadStoryboard.storyboard index 43803d6..ba076a3 100644 --- a/iBean/iBean/iPadStoryboard.storyboard +++ b/iBean/iBean/iPadStoryboard.storyboard @@ -115,19 +115,61 @@ <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <nil key="highlightedColor"/> </label> + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" allowsSelection="NO" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="kVY-BZ-7h3"> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <prototypes> + <tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ExtractionTimeCell" textLabel="eth-SQ-iHG" detailTextLabel="7HL-2K-QkF" imageView="hb2-ca-ZFx" style="IBUITableViewCellStyleValue1" id="2eC-3u-dUw"> + <rect key="frame" x="0.0" y="22" width="768" height="44"/> + <autoresizingMask key="autoresizingMask"/> + <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> + <rect key="frame" x="0.0" y="0.0" width="768" height="43"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="eth-SQ-iHG"> + <rect key="frame" x="40" y="11" width="35" height="21"/> + <autoresizingMask key="autoresizingMask"/> + <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + </label> + <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7HL-2K-QkF"> + <rect key="frame" x="701" y="11" width="57" height="21"/> + <autoresizingMask key="autoresizingMask"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" red="0.21960784310000001" green="0.3294117647" blue="0.52941176469999995" alpha="1" colorSpace="calibratedRGB"/> + <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + </label> + <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" image="78-stopwatch.png" id="hb2-ca-ZFx"> + <rect key="frame" x="8" y="8" width="22" height="26"/> + <autoresizingMask key="autoresizingMask"/> + </imageView> + </subviews> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> + </view> + </tableViewCell> + </prototypes> + <connections> + <outlet property="dataSource" destination="snc-Lv-58m" id="7OT-6z-FIq"/> + <outlet property="delegate" destination="snc-Lv-58m" id="FTY-fb-fqa"/> + </connections> + </tableView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <constraints> + <constraint firstItem="kVY-BZ-7h3" firstAttribute="bottom" secondItem="c9L-k2-8ja" secondAttribute="bottom" type="default" id="0OI-Wc-gKN"/> <constraint firstItem="fba-0S-Ta7" firstAttribute="leading" secondItem="VJ9-6L-0fR" secondAttribute="leading" type="default" id="BIA-1I-GPm"/> <constraint firstAttribute="trailing" secondItem="3SK-4t-P4A" secondAttribute="trailing" constant="20" symbolic="YES" type="default" id="EAy-gu-sto"/> - <constraint firstItem="VJ9-6L-0fR" firstAttribute="centerX" secondItem="3SK-4t-P4A" secondAttribute="centerX" type="default" id="Fn4-X1-mgN"/> + <constraint firstItem="kVY-BZ-7h3" firstAttribute="leading" secondItem="c9L-k2-8ja" secondAttribute="leading" type="default" id="GSB-sg-Hco"/> <constraint firstItem="A29-JZ-SFZ" firstAttribute="centerY" secondItem="xVi-QL-6wy" secondAttribute="centerY" type="default" id="H26-k9-Hrr"/> <constraint firstItem="fba-0S-Ta7" firstAttribute="centerY" secondItem="3SK-4t-P4A" secondAttribute="centerY" type="default" id="LXb-Rx-BW9"/> <constraint firstItem="xVi-QL-6wy" firstAttribute="top" secondItem="3SK-4t-P4A" secondAttribute="bottom" constant="8" symbolic="YES" type="default" id="PEq-Vh-8MB"/> <constraint firstItem="fba-0S-Ta7" firstAttribute="trailing" secondItem="VJ9-6L-0fR" secondAttribute="trailing" type="default" id="RRa-XY-gQg"/> <constraint firstItem="3SK-4t-P4A" firstAttribute="leading" secondItem="c9L-k2-8ja" secondAttribute="leading" constant="20" symbolic="YES" type="default" id="WA1-Rg-W1s"/> <constraint firstItem="VJ9-6L-0fR" firstAttribute="trailing" secondItem="xVi-QL-6wy" secondAttribute="trailing" type="default" id="Wqp-na-wti"/> + <constraint firstItem="VJ9-6L-0fR" firstAttribute="centerX" secondItem="3SK-4t-P4A" secondAttribute="centerX" type="default" id="gor-Yf-XFw"/> <constraint firstItem="A29-JZ-SFZ" firstAttribute="leading" secondItem="c9L-k2-8ja" secondAttribute="leading" constant="20" symbolic="YES" type="default" id="nYl-JE-Sq7"/> + <constraint firstItem="kVY-BZ-7h3" firstAttribute="top" secondItem="A29-JZ-SFZ" secondAttribute="bottom" constant="8" symbolic="YES" type="default" id="ol3-f4-pL5"/> + <constraint firstItem="kVY-BZ-7h3" firstAttribute="trailing" secondItem="c9L-k2-8ja" secondAttribute="trailing" type="default" id="oo9-2o-VtC"/> <constraint firstItem="VJ9-6L-0fR" firstAttribute="top" secondItem="c9L-k2-8ja" secondAttribute="top" constant="369" id="qZZ-cg-KNe"/> <constraint firstItem="3SK-4t-P4A" firstAttribute="top" secondItem="c9L-k2-8ja" secondAttribute="top" constant="20" symbolic="YES" type="default" id="tNh-sD-r9U"/> <constraint firstItem="xVi-QL-6wy" firstAttribute="leading" secondItem="A29-JZ-SFZ" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="yoA-ii-xSP"/> @@ -140,6 +182,7 @@ <outlet property="extractionSettingLabel" destination="A29-JZ-SFZ" id="Ctr-IB-zCl"/> <outlet property="extractionSettingStepper" destination="xVi-QL-6wy" id="GMr-dJ-oNm"/> <outlet property="extractionStateLabel" destination="VJ9-6L-0fR" id="WxL-6I-r6T"/> + <outlet property="extractionTimesTableView" destination="kVY-BZ-7h3" id="0yB-E9-BU3"/> </connections> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="lBg-Db-hdn" userLabel="First Responder" sceneMemberID="firstResponder"/> @@ -1424,6 +1467,7 @@ <relationship kind="outlet" name="extractionSettingLabel" candidateClass="UILabel"/> <relationship kind="outlet" name="extractionSettingStepper" candidateClass="UIStepper"/> <relationship kind="outlet" name="extractionStateLabel" candidateClass="UILabel"/> + <relationship kind="outlet" name="extractionTimesTableView" candidateClass="UITableView"/> </relationships> </class> <class className="NSLayoutConstraint" superclassName="NSObject"> diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard index 75a27b0..bf68193 100644 --- a/iBean/iBean/iPhoneStoryboard.storyboard +++ b/iBean/iBean/iPhoneStoryboard.storyboard @@ -110,22 +110,60 @@ <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <nil key="highlightedColor"/> </label> + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" allowsSelection="NO" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="b0U-pI-PMW"> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <prototypes> + <tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ExtractionTimeCell" textLabel="1Bo-kW-4Zt" detailTextLabel="S1m-3H-HSH" imageView="Uls-vb-RNm" style="IBUITableViewCellStyleValue1" id="QqQ-qM-vVd"> + <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"> + <rect key="frame" x="0.0" y="0.0" width="320" height="43"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Bo-kW-4Zt"> + <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + </label> + <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="S1m-3H-HSH"> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" red="0.2196078431372549" green="0.32941176470588235" blue="0.52941176470588236" alpha="1" colorSpace="calibratedRGB"/> + <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> + </label> + <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" image="78-stopwatch.png" id="Uls-vb-RNm"> + <rect key="frame" x="8" y="8" width="22" height="26"/> + <autoresizingMask key="autoresizingMask"/> + </imageView> + </subviews> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> + </view> + </tableViewCell> + </prototypes> + <connections> + <outlet property="dataSource" destination="b3D-qj-cdZ" id="e2c-JL-w5q"/> + <outlet property="delegate" destination="b3D-qj-cdZ" id="VPn-kt-5cR"/> + </connections> + </tableView> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstItem="lEG-3K-UB7" firstAttribute="top" secondItem="NBj-4q-93f" secondAttribute="top" constant="51" id="3VI-FF-M7b"/> + <constraint firstItem="b0U-pI-PMW" firstAttribute="top" secondItem="6By-yy-oRj" secondAttribute="bottom" constant="8" symbolic="YES" type="default" id="3Ve-Nn-Xjn"/> <constraint firstItem="Exd-Qz-k8n" firstAttribute="top" secondItem="NBj-4q-93f" secondAttribute="top" constant="168" id="3km-yn-poN"/> <constraint firstItem="Exd-Qz-k8n" firstAttribute="leading" secondItem="NBj-4q-93f" secondAttribute="leading" constant="20" symbolic="YES" type="default" id="CWq-c1-PZo"/> <constraint firstItem="6By-yy-oRj" firstAttribute="leading" secondItem="NBj-4q-93f" secondAttribute="leading" constant="20" symbolic="YES" type="default" id="GeL-hb-8dO"/> <constraint firstItem="bjC-aZ-VLh" firstAttribute="top" secondItem="08M-Z3-AVH" secondAttribute="bottom" constant="8" symbolic="YES" type="default" id="PUE-ps-wpg"/> + <constraint firstItem="b0U-pI-PMW" firstAttribute="trailing" secondItem="NBj-4q-93f" secondAttribute="trailing" type="default" id="T78-cL-PsK"/> <constraint firstAttribute="trailing" secondItem="lEG-3K-UB7" secondAttribute="trailing" constant="20" symbolic="YES" type="default" id="W1F-DA-pzd"/> <constraint firstItem="08M-Z3-AVH" firstAttribute="leading" secondItem="NBj-4q-93f" secondAttribute="leading" constant="20" symbolic="YES" type="default" id="YK9-4J-r5V"/> + <constraint firstItem="b0U-pI-PMW" firstAttribute="bottom" secondItem="NBj-4q-93f" secondAttribute="bottom" type="default" id="f3J-rq-tT7"/> <constraint firstItem="bjC-aZ-VLh" firstAttribute="leading" secondItem="6By-yy-oRj" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="gqd-LV-oGI"/> <constraint firstAttribute="trailing" secondItem="Exd-Qz-k8n" secondAttribute="trailing" constant="20" symbolic="YES" type="default" id="hNm-0v-TZ6"/> <constraint firstItem="lEG-3K-UB7" firstAttribute="leading" secondItem="NBj-4q-93f" secondAttribute="leading" constant="20" symbolic="YES" type="default" id="sSe-lI-xMk"/> <constraint firstItem="08M-Z3-AVH" firstAttribute="top" secondItem="NBj-4q-93f" secondAttribute="top" constant="20" symbolic="YES" type="default" id="uT1-YQ-jSm"/> <constraint firstAttribute="trailing" secondItem="bjC-aZ-VLh" secondAttribute="trailing" constant="20" symbolic="YES" type="default" id="vjV-8h-RcP"/> <constraint firstAttribute="trailing" secondItem="08M-Z3-AVH" secondAttribute="trailing" constant="20" symbolic="YES" type="default" id="xhG-BC-gVb"/> + <constraint firstItem="b0U-pI-PMW" firstAttribute="leading" secondItem="NBj-4q-93f" secondAttribute="leading" type="default" id="xkx-3T-G3u"/> <constraint firstItem="6By-yy-oRj" firstAttribute="centerY" secondItem="bjC-aZ-VLh" secondAttribute="centerY" type="default" id="zq4-iE-v07"/> </constraints> </view> @@ -135,6 +173,7 @@ <outlet property="extractionSettingLabel" destination="6By-yy-oRj" id="jMq-Bk-pTR"/> <outlet property="extractionSettingStepper" destination="bjC-aZ-VLh" id="DHB-HD-dFN"/> <outlet property="extractionStateLabel" destination="Exd-Qz-k8n" id="ufI-rD-d4M"/> + <outlet property="extractionTimesTableView" destination="b0U-pI-PMW" id="Gj7-Qo-8p4"/> </connections> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="cT9-Af-PM7" userLabel="First Responder" sceneMemberID="firstResponder"/> |