diff options
| author | Eddie Ehlin <eddiex@eddiex.se> | 2013-01-27 21:20:26 +0100 | 
|---|---|---|
| committer | Eddie Ehlin <eddiex@eddiex.se> | 2013-01-27 21:20:26 +0100 | 
| commit | 3b5693d56548f402da841d0dd4bfb4fdba53805d (patch) | |
| tree | aad0146d0b60dc13684399c5510b4eaa47459d84 /iBean/iBean | |
| parent | e3f505842ceba21ae0d58886d7424162bbf395d4 (diff) | |
| download | iBean-3b5693d56548f402da841d0dd4bfb4fdba53805d.tar.gz iBean-3b5693d56548f402da841d0dd4bfb4fdba53805d.zip | |
Initial support for Settings. First section (global settings) is implemented, left to do is threshold handling (stubs added).
Diffstat (limited to 'iBean/iBean')
| -rw-r--r-- | iBean/iBean/AppDelegate+Storage.h | 13 | ||||
| -rw-r--r-- | iBean/iBean/AppDelegate+Storage.m | 87 | ||||
| -rw-r--r-- | iBean/iBean/BeanCollectionExtractionViewController.m | 1 | ||||
| -rw-r--r-- | iBean/iBean/Configuration.h | 18 | ||||
| -rw-r--r-- | iBean/iBean/Configuration.m | 5 | ||||
| -rw-r--r-- | iBean/iBean/InstantExtractionViewController.m | 14 | ||||
| -rw-r--r-- | iBean/iBean/SettingsViewController.h | 30 | ||||
| -rw-r--r-- | iBean/iBean/SettingsViewController.m | 140 | ||||
| -rw-r--r-- | iBean/iBean/Threshold.h | 21 | ||||
| -rw-r--r-- | iBean/iBean/Threshold.m | 20 | ||||
| -rw-r--r-- | iBean/iBean/ThresholdCell.h | 26 | ||||
| -rw-r--r-- | iBean/iBean/ThresholdCell.m | 60 | ||||
| -rw-r--r-- | iBean/iBean/ThresholdListViewController.h | 20 | ||||
| -rw-r--r-- | iBean/iBean/ThresholdListViewController.m | 129 | ||||
| -rw-r--r-- | iBean/iBean/ThresholdViewController.h | 20 | ||||
| -rw-r--r-- | iBean/iBean/ThresholdViewController.m | 57 | ||||
| -rw-r--r-- | iBean/iBean/iBean.xcdatamodeld/iBean.xcdatamodel/contents | 13 | ||||
| -rw-r--r-- | iBean/iBean/iPhoneStoryboard.storyboard | 431 | 
18 files changed, 1074 insertions, 31 deletions
| diff --git a/iBean/iBean/AppDelegate+Storage.h b/iBean/iBean/AppDelegate+Storage.h index ad94cb6..44c4a0f 100644 --- a/iBean/iBean/AppDelegate+Storage.h +++ b/iBean/iBean/AppDelegate+Storage.h @@ -28,12 +28,15 @@  - (Configuration*) getConfiguration;  //Extraction counter methods -/* +- (NSError*) setCountExtractions: (BOOL) countExtractions;  - (NSNumber*) getExtractionCount; -- (NSNumber*) increaseExtractionCount; -- (NSNumber*) decreaseExtractionCount; -- (void) resetExtractionCount; -*/ +- (NSError*) setExtractionCount: (NSNumber*) extractionCount; +- (NSNumber*) incrementExtractionCount; + +//Thresholds methods +- (void) processThresholds; + +  //Instant extraction related methods  - (NSError*) setInstantExtractionTimer: (NSNumber*) extractionTimer; diff --git a/iBean/iBean/AppDelegate+Storage.m b/iBean/iBean/AppDelegate+Storage.m index ca0e81d..fc911f6 100644 --- a/iBean/iBean/AppDelegate+Storage.m +++ b/iBean/iBean/AppDelegate+Storage.m @@ -58,7 +58,7 @@        NSLog(@"getConfiguration - Fetch request resulted in an error!");        UIAlertView *loadErrorAlert = [[UIAlertView alloc] -                                     initWithTitle:@"Load error!" +                                     initWithTitle:@"Configuration error!"                                       message:@"Unable to load iBean configuration."                                       delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];        [loadErrorAlert show]; @@ -70,11 +70,12 @@        {          //Set default configuration values:          config.instantExtractionTimer = [NSNumber numberWithDouble:25.0f]; +#warning TODO - Add call to iBean core data startup (to add example data)        }        else        {          UIAlertView *createConfigurationAlert = [[UIAlertView alloc] -                                                 initWithTitle:@"Create config error!" +                                                 initWithTitle:@"Configuration error!"                                                   message:@"iBean unable to create configuration object.\n(Please check memory available.)"                                                   delegate:nil                                                   cancelButtonTitle:@"OK" otherButtonTitles: nil]; @@ -89,6 +90,76 @@    return config;  } +//Extraction count related methods +- (NSError*) setCountExtractions: (BOOL) countExtractions +{ +  NSError *error = nil; +  Configuration *c = [self getConfiguration]; +  if (c != nil) +  { +    c.countExtractions = [NSNumber numberWithBool:countExtractions]; +    error = [self save]; +  } +   +  return error; +} + +- (NSNumber*) getExtractionCount +{ +  NSNumber *extractionCount = nil; +  Configuration* c = [self getConfiguration]; +  extractionCount = c != nil ? c.extractionCount : [NSNumber numberWithInt:-1]; +  return extractionCount; +} + +- (NSError*) setExtractionCount: (NSNumber*) extractionCount +{ +  NSError *error = nil; +  Configuration *c = [self getConfiguration]; +  if (c != nil) +  { +    c.extractionCount = extractionCount < 0 ? 0 : extractionCount; +    error = [self save]; +     +    if (error != nil) +    { +      UIAlertView *setExtractionCountAlert = [[UIAlertView alloc] +                                              initWithTitle:@"Configuration error!" +                                              message:@"iBean unable to set extraction count value." +                                              delegate:nil +                                              cancelButtonTitle:@"OK" otherButtonTitles: nil]; +      [setExtractionCountAlert show]; +    } +  } +   +  return error; +} + +- (NSNumber*) incrementExtractionCount +{ +  Configuration *c = [self getConfiguration]; +   +  if (c != nil) +  { +    if ([c.countExtractions boolValue] == YES) +    { +      if ([self setExtractionCount:[NSNumber numberWithInteger:([c.extractionCount integerValue] + 1)]] != nil) +      { +        [self processThresholds]; +        return c.extractionCount; +      } +    } +  } +  return [NSNumber numberWithInteger:-1]; +} + +- (void) processThresholds +{ +#warning TODO - Implement this +  //Simply go through the thresholds array and alert on those that are enabled and "active". +  //Find out how to make the list of thresholds sorted on the value. +} +  #pragma mark - Instant extraction related methods (using Configuraiton)  - (NSError*)setInstantExtractionTimer:(NSNumber *)extractionTimer  { @@ -98,8 +169,18 @@    if (c != nil)    {      c.instantExtractionTimer = extractionTimer; -    error = [(AppDelegate*) [[UIApplication sharedApplication] delegate] save]; +    error = [self save];    } +   +  if (error != nil) +  { +    UIAlertView *setInstantExtractionTimerAlert = [[UIAlertView alloc] +                                   initWithTitle:@"Configuration error!" +                                   message:@"iBean unable to set extraction timer setting for instant extraction." +                                   delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; +    [setInstantExtractionTimerAlert show]; +  } +      return error;    } diff --git a/iBean/iBean/BeanCollectionExtractionViewController.m b/iBean/iBean/BeanCollectionExtractionViewController.m index 785c981..dea550d 100644 --- a/iBean/iBean/BeanCollectionExtractionViewController.m +++ b/iBean/iBean/BeanCollectionExtractionViewController.m @@ -99,6 +99,7 @@    {      NSLog(@"Timer reached its limit!");      [self haltExtractionTimer]; +    NSLog(@"Extraction count = %@", [(AppDelegate*) [[UIApplication sharedApplication] delegate] incrementExtractionCount]);    }  } diff --git a/iBean/iBean/Configuration.h b/iBean/iBean/Configuration.h index 3753bd6..00159ce 100644 --- a/iBean/iBean/Configuration.h +++ b/iBean/iBean/Configuration.h @@ -9,9 +9,27 @@  #import <Foundation/Foundation.h>  #import <CoreData/CoreData.h> +@class Threshold;  @interface Configuration : NSManagedObject  @property (nonatomic, retain) NSNumber * instantExtractionTimer; +@property (nonatomic, retain) NSNumber * extractionCount; +@property (nonatomic, retain) NSNumber * countExtractions; +@property (nonatomic, retain) NSNumber * useThresholds; +@property (nonatomic, retain) NSOrderedSet *thresholds; +@end + +@interface Configuration (CoreDataGeneratedAccessors) +- (void)insertObject:(Threshold *)value inThresholdsAtIndex:(NSUInteger)idx; +- (void)removeObjectFromThresholdsAtIndex:(NSUInteger)idx; +- (void)insertThresholds:(NSArray *)value atIndexes:(NSIndexSet *)indexes; +- (void)removeThresholdsAtIndexes:(NSIndexSet *)indexes; +- (void)replaceObjectInThresholdsAtIndex:(NSUInteger)idx withObject:(Threshold *)value; +- (void)replaceThresholdsAtIndexes:(NSIndexSet *)indexes withThresholds:(NSArray *)values; +- (void)addThresholdsObject:(Threshold *)value; +- (void)removeThresholdsObject:(Threshold *)value; +- (void)addThresholds:(NSOrderedSet *)values; +- (void)removeThresholds:(NSOrderedSet *)values;  @end diff --git a/iBean/iBean/Configuration.m b/iBean/iBean/Configuration.m index cba131b..e086bdd 100644 --- a/iBean/iBean/Configuration.m +++ b/iBean/iBean/Configuration.m @@ -7,10 +7,15 @@  //  #import "Configuration.h" +#import "Threshold.h"  @implementation Configuration  @dynamic instantExtractionTimer; +@dynamic extractionCount; +@dynamic countExtractions; +@dynamic useThresholds; +@dynamic thresholds;  @end diff --git a/iBean/iBean/InstantExtractionViewController.m b/iBean/iBean/InstantExtractionViewController.m index 0ab0a9c..4c02b62 100644 --- a/iBean/iBean/InstantExtractionViewController.m +++ b/iBean/iBean/InstantExtractionViewController.m @@ -66,6 +66,7 @@    {      NSLog(@"Timer reached its limit!");      [self haltExtractionTimer]; +    NSLog(@"Extraction count = %@", [(AppDelegate*) [[UIApplication sharedApplication] delegate] incrementExtractionCount]);    }  } @@ -116,16 +117,7 @@  - (IBAction)setExtractionTimer:(id)sender {    NSError* error = [(AppDelegate*) [[UIApplication sharedApplication] delegate] setInstantExtractionTimer:[NSNumber numberWithDouble:self.extractionSettingStepper.value]]; -  if (error != nil) -  { -    NSLog(@"InstantExtraction unable to save configuration!"); -    UIAlertView *saveErrorAlert = [[UIAlertView alloc] -                                   initWithTitle:@"Save error!" -                                   message:@"Unable to save configuration." -                                   delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; -    [saveErrorAlert show]; -  } -   -  [self updateExtractionSettingLabel]; +  if (error == nil) +    [self updateExtractionSettingLabel];  }  @end diff --git a/iBean/iBean/SettingsViewController.h b/iBean/iBean/SettingsViewController.h new file mode 100644 index 0000000..86b14bd --- /dev/null +++ b/iBean/iBean/SettingsViewController.h @@ -0,0 +1,30 @@ +// +//  SettingsViewController.h +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import <UIKit/UIKit.h> +@class Configuration; + +@interface SettingsViewController : UITableViewController + +@property (nonatomic, strong) Configuration *configuration; + +/* Utility methods */ +- (void) initViewController; + +/* UI Outlets */ +@property (weak, nonatomic) IBOutlet UISwitch *countExtractionsSwitch; +@property (weak, nonatomic) IBOutlet UISwitch *useThresholdsSwitch; +@property (weak, nonatomic) IBOutlet UIStepper *extractionCountStepper; +@property (weak, nonatomic) IBOutlet UILabel *extractionCountLabel; + +/* UI Actions */ +- (IBAction)countExtractionsSwitchChanged:(id)sender; +- (IBAction)useThresholdsSwitchChanged:(id)sender; +- (IBAction)extractionCountStepperChanged:(id)sender; + +@end diff --git a/iBean/iBean/SettingsViewController.m b/iBean/iBean/SettingsViewController.m new file mode 100644 index 0000000..cce498f --- /dev/null +++ b/iBean/iBean/SettingsViewController.m @@ -0,0 +1,140 @@ +// +//  SettingsViewController.m +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import "SettingsViewController.h" +#import "Configuration+Interface.h" +#import "AppDelegate+Storage.h" + +@interface SettingsViewController () + +@end + +@implementation SettingsViewController + +- (id)initWithStyle:(UITableViewStyle)style +{ +    self = [super initWithStyle:style]; +    if (self) { +        // Custom initialization +    } +    return self; +} + +- (void)viewDidLoad +{ +    [super viewDidLoad]; + +    // Uncomment the following line to preserve selection between presentations. +    // self.clearsSelectionOnViewWillAppear = NO; +  +    // Uncomment the following line to display an Edit button in the navigation bar for this view controller. +    // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void) viewWillAppear:(BOOL)animated +{ +  [super viewWillAppear:animated]; +  [self initViewController]; +} + +- (void)didReceiveMemoryWarning +{ +    [super didReceiveMemoryWarning]; +    // Dispose of any resources that can be recreated. +} + +/***************************************************** + Utility methods + *****************************************************/ +- (void) initViewController +{ +  NSLog(@"SettingsViewController - initViewController"); +   +  //Let's go fetch Configuration! +  self.configuration = [(AppDelegate*) [[UIApplication sharedApplication] delegate] getConfiguration]; +   +  if (self.configuration != nil) +  { +    self.countExtractionsSwitch.on = [self.configuration.countExtractions boolValue]; +    self.useThresholdsSwitch.on = [self.configuration.useThresholds boolValue]; +     +    self.extractionCountLabel.text = [self.configuration.extractionCount stringValue]; +    self.extractionCountStepper.value = [self.configuration.extractionCount integerValue]; +  } +  else +  { +    self.countExtractionsSwitch.enabled = NO; +    self.useThresholdsSwitch.enabled = NO; +    self.extractionCountStepper.enabled = NO; +  } +} + +/***************************************************** + UI Actions + *****************************************************/ +- (void) countExtractionsSwitchChanged:(id)sender +{ +  if (self.configuration != nil) +  { +    self.configuration.countExtractions = [NSNumber numberWithBool: self.countExtractionsSwitch.on]; +    NSError *error = [(AppDelegate*) [[UIApplication sharedApplication] delegate] save]; +    if (error != nil) +    { +      UIAlertView *setCountExtractionsAlert = [[UIAlertView alloc] +                                               initWithTitle:@"Configuration error!" +                                               message:@"iBean was not able to save configuration attribute for \"Count extractions\"." +                                               delegate:nil +                                               cancelButtonTitle:@"OK" otherButtonTitles: nil]; +      [setCountExtractionsAlert show]; +    } +  } +} + +- (void) useThresholdsSwitchChanged:(id)sender +{ +  if (self.configuration != nil) +  { +    self.configuration.useThresholds = [NSNumber numberWithBool: self.useThresholdsSwitch.on]; +    NSError *error = [(AppDelegate*) [[UIApplication sharedApplication] delegate] save]; +    if (error != nil) +    { +      UIAlertView *setUseThresholdsAlert = [[UIAlertView alloc] +                                               initWithTitle:@"Configuration error!" +                                               message:@"iBean was not able to save configuration attribute for \"Thresholds\"." +                                               delegate:nil +                                               cancelButtonTitle:@"OK" otherButtonTitles: nil]; +      [setUseThresholdsAlert show]; +    } +  } +} + +- (void) extractionCountStepperChanged:(id)sender +{ +  if (self.configuration != nil) +  { +    self.configuration.extractionCount = [NSNumber numberWithDouble:self.extractionCountStepper.value]; +     +    self.extractionCountLabel.text = [self.configuration.extractionCount stringValue]; +    NSError *error = [(AppDelegate*) [[UIApplication sharedApplication] delegate] save]; +    if (error != nil) +    { +      UIAlertView *setExtractionCountAlert = [[UIAlertView alloc] +                                               initWithTitle:@"Configuration error!" +                                               message:@"iBean was not able to save configuration attribute for \"Extraction count\"." +                                               delegate:nil +                                               cancelButtonTitle:@"OK" otherButtonTitles: nil]; +      [setExtractionCountAlert show]; +    } +  } +} + +/***************************************************** + Delegates + *****************************************************/ + +@end diff --git a/iBean/iBean/Threshold.h b/iBean/iBean/Threshold.h new file mode 100644 index 0000000..7034bcd --- /dev/null +++ b/iBean/iBean/Threshold.h @@ -0,0 +1,21 @@ +// +//  Threshold.h +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import <Foundation/Foundation.h> +#import <CoreData/CoreData.h> + +@class Configuration; + +@interface Threshold : NSManagedObject + +@property (nonatomic, retain) NSString * name; +@property (nonatomic, retain) NSNumber * value; +@property (nonatomic, retain) NSNumber * enabled; +@property (nonatomic, retain) Configuration *configuration; + +@end diff --git a/iBean/iBean/Threshold.m b/iBean/iBean/Threshold.m new file mode 100644 index 0000000..e8c6d85 --- /dev/null +++ b/iBean/iBean/Threshold.m @@ -0,0 +1,20 @@ +// +//  Threshold.m +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import "Threshold.h" +#import "Configuration.h" + + +@implementation Threshold + +@dynamic name; +@dynamic value; +@dynamic enabled; +@dynamic configuration; + +@end diff --git a/iBean/iBean/ThresholdCell.h b/iBean/iBean/ThresholdCell.h new file mode 100644 index 0000000..30c2db0 --- /dev/null +++ b/iBean/iBean/ThresholdCell.h @@ -0,0 +1,26 @@ +// +//  ThresholdCell.h +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import <UIKit/UIKit.h> +@class Threshold; + +@interface ThresholdCell : UITableViewCell + +@property (strong, nonatomic) Threshold* threshold; + +@property (weak, nonatomic) IBOutlet UISwitch *enabledSwitch; +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *valueLabel; + +/* Utility methods */ +- (void) initWithThresholdEntity: (Threshold*) threshold; + +/* UI Actions */ +- (IBAction)switchChanged:(id)sender; + +@end diff --git a/iBean/iBean/ThresholdCell.m b/iBean/iBean/ThresholdCell.m new file mode 100644 index 0000000..b18bd57 --- /dev/null +++ b/iBean/iBean/ThresholdCell.m @@ -0,0 +1,60 @@ +// +//  ThresholdCell.m +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import "ThresholdCell.h" +#import "Threshold.h" + +@implementation ThresholdCell + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ +    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; +    if (self) { +        // Initialization code +      NSLog(@"ThresholdCell - initWithStyle"); +    } +    return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ +    [super setSelected:selected animated:animated]; + +    // Configure the view for the selected state +} + +/***************************************************** + Utility methods + *****************************************************/ +- (void) initWithThresholdEntity:(Threshold *)threshold +{ +  self.threshold = threshold; +  if (self.threshold != nil) +  { +    self.nameLabel.text = self.threshold.name; +    self.valueLabel.text = [self.threshold.value stringValue]; +    self.enabledSwitch.on = [self.threshold.enabled boolValue]; +  } +   +  //Setup UI action +  [self.enabledSwitch addTarget:self action:@selector(switchChanged:) forControlEvents:UIControlEventValueChanged]; +} + +/***************************************************** + UI Actions + *****************************************************/ +- (void) switchChanged:(id)sender +{ +  if (self.threshold != nil) +  { +    self.threshold.enabled = [NSNumber numberWithBool:self.enabledSwitch.on]; +#warning TODO - Trigger save!? +  } +} + +@end diff --git a/iBean/iBean/ThresholdListViewController.h b/iBean/iBean/ThresholdListViewController.h new file mode 100644 index 0000000..eb909d7 --- /dev/null +++ b/iBean/iBean/ThresholdListViewController.h @@ -0,0 +1,20 @@ +// +//  ThresholdListViewController.h +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@interface ThresholdListViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> + +/* Utility methods */ +- (void) initViewController; + +/* UI Outlets */ + +/* UI Actions */ + +@end diff --git a/iBean/iBean/ThresholdListViewController.m b/iBean/iBean/ThresholdListViewController.m new file mode 100644 index 0000000..d6ce20e --- /dev/null +++ b/iBean/iBean/ThresholdListViewController.m @@ -0,0 +1,129 @@ +// +//  ThresholdListViewController.m +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import "ThresholdListViewController.h" + +@interface ThresholdListViewController () + +@end + +@implementation ThresholdListViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ +    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; +    if (self) { +        // Custom initialization +    } +    return self; +} + +- (void)viewDidLoad +{ +    [super viewDidLoad]; +	// Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ +    [super didReceiveMemoryWarning]; +    // Dispose of any resources that can be recreated. +} + +/***************************************************** + Utility methods + *****************************************************/ + + +/***************************************************** + UI Actions + *****************************************************/ + + +/***************************************************** + Delegates + *****************************************************/ +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ +#warning Potentially incomplete method implementation. +  // Return the number of sections. +  return 0; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ +#warning Incomplete method implementation. +  // Return the number of rows in the section. +  return 0; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ +  static NSString *CellIdentifier = @"ThresholdCell"; +  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; +   +  // Configure the cell... +   +  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. + 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 + [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 rearranging the table view. + - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath + { + } + */ + +/* + // 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 YES; + } + */ + +#pragma mark - Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ +  // Navigation logic may go here. Create and push another view controller. +  /* +   <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil]; +   // ... +   // Pass the selected object to the new view controller. +   [self.navigationController pushViewController:detailViewController animated:YES]; +   */ +} + +@end diff --git a/iBean/iBean/ThresholdViewController.h b/iBean/iBean/ThresholdViewController.h new file mode 100644 index 0000000..dc63752 --- /dev/null +++ b/iBean/iBean/ThresholdViewController.h @@ -0,0 +1,20 @@ +// +//  ThresholdViewController.h +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@interface ThresholdViewController : UITableViewController + +/* Utility methods */ +- (void) initViewController; + +/* UI Outlets */ + +/* UI Actions */ + +@end diff --git a/iBean/iBean/ThresholdViewController.m b/iBean/iBean/ThresholdViewController.m new file mode 100644 index 0000000..1769dfe --- /dev/null +++ b/iBean/iBean/ThresholdViewController.m @@ -0,0 +1,57 @@ +// +//  ThresholdViewController.m +//  iBean +// +//  Created by Eddie Ehlin on 2013-01-27. +//  Copyright (c) 2013 Eddie Ehlin. All rights reserved. +// + +#import "ThresholdViewController.h" + +@interface ThresholdViewController () + +@end + +@implementation ThresholdViewController + +- (id)initWithStyle:(UITableViewStyle)style +{ +    self = [super initWithStyle:style]; +    if (self) { +        // Custom initialization +    } +    return self; +} + +- (void)viewDidLoad +{ +    [super viewDidLoad]; + +    // Uncomment the following line to preserve selection between presentations. +    // self.clearsSelectionOnViewWillAppear = NO; +  +    // Uncomment the following line to display an Edit button in the navigation bar for this view controller. +    // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void)didReceiveMemoryWarning +{ +    [super didReceiveMemoryWarning]; +    // Dispose of any resources that can be recreated. +} + +/***************************************************** + Utility methods + *****************************************************/ + + +/***************************************************** + UI Actions + *****************************************************/ + + +/***************************************************** + Delegates + *****************************************************/ + +@end diff --git a/iBean/iBean/iBean.xcdatamodeld/iBean.xcdatamodel/contents b/iBean/iBean/iBean.xcdatamodeld/iBean.xcdatamodel/contents index f89e12d..f421adc 100644 --- a/iBean/iBean/iBean.xcdatamodeld/iBean.xcdatamodel/contents +++ b/iBean/iBean/iBean.xcdatamodeld/iBean.xcdatamodel/contents @@ -16,11 +16,22 @@          <relationship name="beans" optional="YES" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="Bean" inverseName="beanCollection" inverseEntity="Bean" syncable="YES"/>      </entity>      <entity name="Configuration" representedClassName="Configuration" syncable="YES"> +        <attribute name="countExtractions" optional="YES" attributeType="Boolean" syncable="YES"/> +        <attribute name="extractionCount" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>          <attribute name="instantExtractionTimer" optional="YES" attributeType="Double" defaultValueString="0.0" syncable="YES"/> +        <attribute name="useThresholds" optional="YES" attributeType="Boolean" syncable="YES"/> +        <relationship name="thresholds" optional="YES" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="Threshold" inverseName="configuration" inverseEntity="Threshold" syncable="YES"/> +    </entity> +    <entity name="Threshold" representedClassName="Threshold" syncable="YES"> +        <attribute name="enabled" optional="YES" attributeType="Boolean" syncable="YES"/> +        <attribute name="name" optional="YES" attributeType="String" syncable="YES"/> +        <attribute name="value" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/> +        <relationship name="configuration" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Configuration" inverseName="thresholds" inverseEntity="Configuration" syncable="YES"/>      </entity>      <elements>          <element name="Bean" positionX="-369" positionY="111" width="128" height="105"/>          <element name="BeanCollection" positionX="160" positionY="192" width="128" height="150"/> -        <element name="Configuration" positionX="160" positionY="192" width="128" height="60"/> +        <element name="Configuration" positionX="324" positionY="18" width="128" height="118"/> +        <element name="Threshold" positionX="88" positionY="-63" width="128" height="103"/>      </elements>  </model>
\ No newline at end of file diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard index 2cb8195..683bc9f 100644 --- a/iBean/iBean/iPhoneStoryboard.storyboard +++ b/iBean/iBean/iPhoneStoryboard.storyboard @@ -57,7 +57,7 @@                  </tableViewController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="BXw-pd-TpS" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="1285" y="403"/> +            <point key="canvasLocation" x="1303" y="-153"/>          </scene>          <!--Instant Extraction View Controller - Insta bean-->          <scene sceneID="Lvr-w4-t8a"> @@ -128,7 +128,7 @@                  </viewController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="cT9-Af-PM7" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="755" y="-353"/> +            <point key="canvasLocation" x="759" y="-844"/>          </scene>          <!--Tab Bar Controller-->          <scene sceneID="49X-K1-BnE"> @@ -143,12 +143,375 @@                      <connections>                          <segue destination="jaX-Mv-rfK" kind="relationship" relationship="viewControllers" id="03i-y5-VsE"/>                          <segue destination="b3D-qj-cdZ" kind="relationship" relationship="viewControllers" id="whM-gB-3Ap"/> +                        <segue destination="A4w-PM-KKG" kind="relationship" relationship="viewControllers" id="lhi-kO-O3w"/>                      </connections>                  </tabBarController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="iKP-Ml-w9b" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects>              <point key="canvasLocation" x="13" y="-353"/>          </scene> +        <!--Settings View Controller - Settings--> +        <scene sceneID="IDX-hj-f0d"> +            <objects> +                <tableViewController id="kQZ-wX-3ix" customClass="SettingsViewController" sceneMemberID="viewController"> +                    <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="singleLineEtched" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="vuI-ek-Bgr"> +                        <rect key="frame" x="0.0" y="64" width="320" height="455"/> +                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> +                        <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> +                        <sections> +                            <tableViewSection headerTitle="iBean Settings" id="wDL-0c-vck"> +                                <cells> +                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="qE1-q5-eDt"> +                                        <rect key="frame" x="0.0" y="46" width="320" height="45"/> +                                        <autoresizingMask key="autoresizingMask"/> +                                        <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> +                                            <rect key="frame" x="10" y="1" width="300" height="43"/> +                                            <autoresizingMask key="autoresizingMask"/> +                                            <subviews> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Count extractions" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FfK-86-nMg"> +                                                    <constraints> +                                                        <constraint firstAttribute="width" constant="175" id="Ll1-NF-5HL"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" name="Helvetica" family="Helvetica" pointSize="17"/> +                                                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                                <switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fFt-HH-tY2"> +                                                    <connections> +                                                        <action selector="countExtractionsSwitchChanged:" destination="kQZ-wX-3ix" eventType="valueChanged" id="VBK-HA-HNP"/> +                                                    </connections> +                                                </switch> +                                            </subviews> +                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> +                                        </view> +                                        <constraints> +                                            <constraint firstItem="fFt-HH-tY2" firstAttribute="leading" secondItem="FfK-86-nMg" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="9Fq-70-Kde"/> +                                            <constraint firstItem="FfK-86-nMg" firstAttribute="leading" secondItem="qE1-q5-eDt" secondAttribute="leading" constant="30" id="KLb-bX-IPt"/> +                                            <constraint firstItem="FfK-86-nMg" firstAttribute="centerY" secondItem="qE1-q5-eDt" secondAttribute="centerY" type="default" id="XqV-Bl-E2U"/> +                                            <constraint firstItem="fFt-HH-tY2" firstAttribute="centerY" secondItem="FfK-86-nMg" secondAttribute="centerY" type="default" id="peZ-am-x9P"/> +                                        </constraints> +                                    </tableViewCell> +                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="EaT-Mm-AR5"> +                                        <rect key="frame" x="0.0" y="91" width="320" height="45"/> +                                        <autoresizingMask key="autoresizingMask"/> +                                        <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> +                                            <rect key="frame" x="10" y="0.0" width="300" height="43"/> +                                            <autoresizingMask key="autoresizingMask"/> +                                            <subviews> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Thresholds" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CgT-Rp-phu"> +                                                    <constraints> +                                                        <constraint firstAttribute="width" constant="175" id="EcT-Xz-a7Q"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/> +                                                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                                <switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iyy-6c-Dl5"> +                                                    <connections> +                                                        <action selector="useThresholdsSwitchChanged:" destination="kQZ-wX-3ix" eventType="valueChanged" id="42Q-S7-0tz"/> +                                                    </connections> +                                                </switch> +                                            </subviews> +                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> +                                        </view> +                                        <constraints> +                                            <constraint firstItem="iyy-6c-Dl5" firstAttribute="top" secondItem="EaT-Mm-AR5" secondAttribute="top" constant="8" id="UqK-tL-heO"/> +                                            <constraint firstItem="iyy-6c-Dl5" firstAttribute="centerY" secondItem="CgT-Rp-phu" secondAttribute="centerY" type="default" id="eNW-hD-3qs"/> +                                            <constraint firstItem="iyy-6c-Dl5" firstAttribute="leading" secondItem="CgT-Rp-phu" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="luf-QT-wvl"/> +                                            <constraint firstItem="CgT-Rp-phu" firstAttribute="leading" secondItem="EaT-Mm-AR5" secondAttribute="leading" constant="30" id="peS-3N-zfb"/> +                                        </constraints> +                                    </tableViewCell> +                                </cells> +                            </tableViewSection> +                            <tableViewSection headerTitle="iBean Data" id="FnM-qR-V8p"> +                                <cells> +                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="r9O-D5-k1M"> +                                        <rect key="frame" x="0.0" y="182" width="320" height="45"/> +                                        <autoresizingMask key="autoresizingMask"/> +                                        <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> +                                            <rect key="frame" x="10" y="1" width="300" height="43"/> +                                            <autoresizingMask key="autoresizingMask"/> +                                            <subviews> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Extractions" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="km0-m9-Uso"> +                                                    <constraints> +                                                        <constraint firstAttribute="width" constant="158" id="FsQ-Zy-q0i"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/> +                                                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                                <stepper opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="10000000" translatesAutoresizingMaskIntoConstraints="NO" id="ijG-QW-wOy"> +                                                    <connections> +                                                        <action selector="extractionCountStepperChanged:" destination="kQZ-wX-3ix" eventType="valueChanged" id="AJQ-HS-1Ln"/> +                                                    </connections> +                                                </stepper> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Number of extractions" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TgN-Et-A27"> +                                                    <constraints> +                                                        <constraint firstAttribute="height" constant="21" id="cs3-x4-oSD"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/> +                                                    <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                            </subviews> +                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> +                                        </view> +                                        <constraints> +                                            <constraint firstItem="ijG-QW-wOy" firstAttribute="centerY" secondItem="r9O-D5-k1M" secondAttribute="centerY" type="default" id="3jk-3j-3a9"/> +                                            <constraint firstItem="km0-m9-Uso" firstAttribute="leading" secondItem="r9O-D5-k1M" secondAttribute="leading" constant="30" id="9sz-z3-MKW"/> +                                            <constraint firstItem="ijG-QW-wOy" firstAttribute="leading" secondItem="km0-m9-Uso" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="I94-NM-CIv"/> +                                            <constraint firstItem="TgN-Et-A27" firstAttribute="leading" secondItem="km0-m9-Uso" secondAttribute="leading" type="default" id="hNw-MA-UTa"/> +                                            <constraint firstItem="TgN-Et-A27" firstAttribute="top" secondItem="r9O-D5-k1M" secondAttribute="top" constant="21" id="hdj-jU-Lce"/> +                                            <constraint firstItem="km0-m9-Uso" firstAttribute="top" secondItem="r9O-D5-k1M" secondAttribute="top" constant="3" id="nIo-yb-Feb"/> +                                            <constraint firstItem="ijG-QW-wOy" firstAttribute="leading" secondItem="TgN-Et-A27" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="pYL-cX-chv"/> +                                        </constraints> +                                    </tableViewCell> +                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="noJ-aA-kKf"> +                                        <rect key="frame" x="0.0" y="227" width="320" height="45"/> +                                        <autoresizingMask key="autoresizingMask"/> +                                        <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> +                                            <rect key="frame" x="10" y="0.0" width="280" height="43"/> +                                            <autoresizingMask key="autoresizingMask"/> +                                            <subviews> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Thresholds" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8gp-G0-eVi"> +                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/> +                                                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                            </subviews> +                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> +                                        </view> +                                        <constraints> +                                            <constraint firstItem="8gp-G0-eVi" firstAttribute="leading" secondItem="noJ-aA-kKf" secondAttribute="leading" constant="30" id="K7N-34-51U"/> +                                            <constraint firstItem="8gp-G0-eVi" firstAttribute="top" secondItem="noJ-aA-kKf" secondAttribute="top" constant="11" id="RKe-IJ-EL2"/> +                                        </constraints> +                                        <connections> +                                            <segue destination="XZe-6y-tUN" kind="push" id="vNf-1Q-64U"/> +                                        </connections> +                                    </tableViewCell> +                                </cells> +                            </tableViewSection> +                        </sections> +                        <connections> +                            <outlet property="dataSource" destination="kQZ-wX-3ix" id="FDb-Eg-ydy"/> +                            <outlet property="delegate" destination="kQZ-wX-3ix" id="S7F-bh-nTI"/> +                        </connections> +                    </tableView> +                    <navigationItem key="navigationItem" title="Settings" id="a2r-IZ-2RH"/> +                    <connections> +                        <outlet property="countExtractionsSwitch" destination="fFt-HH-tY2" id="b7e-GC-dZC"/> +                        <outlet property="extractionCountLabel" destination="TgN-Et-A27" id="89x-Ku-lXK"/> +                        <outlet property="extractionCountStepper" destination="ijG-QW-wOy" id="O0a-Ir-xwj"/> +                        <outlet property="useThresholdsSwitch" destination="iyy-6c-Dl5" id="Vvr-F6-jwd"/> +                    </connections> +                </tableViewController> +                <placeholder placeholderIdentifier="IBFirstResponder" id="jsu-wq-7PB" userLabel="First Responder" sceneMemberID="firstResponder"/> +            </objects> +            <point key="canvasLocation" x="1385" y="1288"/> +        </scene> +        <!--Threshold List View Controller - Thresholds--> +        <scene sceneID="iLg-ND-yAi"> +            <objects> +                <viewController id="XZe-6y-tUN" customClass="ThresholdListViewController" sceneMemberID="viewController"> +                    <view key="view" contentMode="scaleToFill" id="mrf-lS-W0h"> +                        <rect key="frame" x="0.0" y="64" width="320" height="455"/> +                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> +                        <subviews> +                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="hI0-rM-L5l"> +                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                <prototypes> +                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="ThresholdCell" id="MT0-Bs-5uV" customClass="ThresholdCell"> +                                        <rect key="frame" x="0.0" y="22" width="320" height="44"/> +                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> +                                        <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> +                                            <rect key="frame" x="0.0" y="0.0" width="300" height="43"/> +                                            <autoresizingMask key="autoresizingMask"/> +                                            <subviews> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Threshold name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FsO-pb-F7O"> +                                                    <constraints> +                                                        <constraint firstAttribute="width" constant="179" id="kNx-qY-o7X"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/> +                                                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Threshold value" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0EW-vb-UQB"> +                                                    <constraints> +                                                        <constraint firstAttribute="height" constant="21" id="d0k-fL-j8N"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/> +                                                    <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                                <switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Cs9-ms-IQm"/> +                                            </subviews> +                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> +                                        </view> +                                        <constraints> +                                            <constraint firstItem="FsO-pb-F7O" firstAttribute="leading" secondItem="Cs9-ms-IQm" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="4s6-H4-U9s"/> +                                            <constraint firstItem="FsO-pb-F7O" firstAttribute="trailing" secondItem="0EW-vb-UQB" secondAttribute="trailing" type="default" id="Bvh-Wt-2WS"/> +                                            <constraint firstItem="0EW-vb-UQB" firstAttribute="top" secondItem="MT0-Bs-5uV" secondAttribute="top" constant="20" type="default" id="Epa-zg-jb6"/> +                                            <constraint firstItem="Cs9-ms-IQm" firstAttribute="top" secondItem="MT0-Bs-5uV" secondAttribute="top" constant="8" id="Py0-o4-yMY"/> +                                            <constraint firstItem="Cs9-ms-IQm" firstAttribute="leading" secondItem="MT0-Bs-5uV" secondAttribute="leading" constant="20" type="default" id="WGc-Z2-cQS"/> +                                            <constraint firstItem="FsO-pb-F7O" firstAttribute="top" secondItem="MT0-Bs-5uV" secondAttribute="top" constant="2" id="bFZ-2H-ugH"/> +                                            <constraint firstItem="0EW-vb-UQB" firstAttribute="leading" secondItem="Cs9-ms-IQm" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="leG-MD-fWJ"/> +                                        </constraints> +                                        <connections> +                                            <outlet property="enabledSwitch" destination="Cs9-ms-IQm" id="8NL-xP-2Jv"/> +                                            <outlet property="nameLabel" destination="FsO-pb-F7O" id="h4d-YC-YO5"/> +                                            <outlet property="valueLabel" destination="0EW-vb-UQB" id="hRj-YY-fBo"/> +                                            <segue destination="0Fo-5M-9Kc" kind="push" identifier="ThresholdsEditThresholdSegue" id="qk2-F5-M1s"/> +                                        </connections> +                                    </tableViewCell> +                                </prototypes> +                                <connections> +                                    <outlet property="dataSource" destination="XZe-6y-tUN" id="q9P-No-UcK"/> +                                    <outlet property="delegate" destination="XZe-6y-tUN" id="AFn-fA-mhv"/> +                                </connections> +                            </tableView> +                            <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ixE-eI-jK9"> +                                <items> +                                    <barButtonItem systemItem="edit" id="pfh-Br-yHh"/> +                                    <barButtonItem style="plain" systemItem="flexibleSpace" id="QcW-iO-KPT"/> +                                    <barButtonItem systemItem="add" id="Hw8-N9-QUf"> +                                        <connections> +                                            <segue destination="0Fo-5M-9Kc" kind="push" identifier="ThresholdsAddNewThresholdSegue" id="EsA-2d-QNt"/> +                                        </connections> +                                    </barButtonItem> +                                </items> +                            </toolbar> +                        </subviews> +                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> +                        <constraints> +                            <constraint firstItem="hI0-rM-L5l" firstAttribute="top" secondItem="mrf-lS-W0h" secondAttribute="top" type="default" id="3N6-8K-Bv1"/> +                            <constraint firstItem="hI0-rM-L5l" firstAttribute="trailing" secondItem="mrf-lS-W0h" secondAttribute="trailing" type="default" id="93n-kn-SfP"/> +                            <constraint firstItem="ixE-eI-jK9" firstAttribute="bottom" secondItem="mrf-lS-W0h" secondAttribute="bottom" type="default" id="ABz-JY-4cx"/> +                            <constraint firstItem="ixE-eI-jK9" firstAttribute="leading" secondItem="mrf-lS-W0h" secondAttribute="leading" type="default" id="BPd-lP-LEh"/> +                            <constraint firstItem="hI0-rM-L5l" firstAttribute="bottom" secondItem="ixE-eI-jK9" secondAttribute="top" type="default" id="KfB-1y-HqH"/> +                            <constraint firstItem="ixE-eI-jK9" firstAttribute="trailing" secondItem="mrf-lS-W0h" secondAttribute="trailing" type="default" id="js4-do-sec"/> +                            <constraint firstItem="hI0-rM-L5l" firstAttribute="leading" secondItem="mrf-lS-W0h" secondAttribute="leading" type="default" id="tfj-11-6yn"/> +                        </constraints> +                    </view> +                    <navigationItem key="navigationItem" title="Thresholds" id="g7z-WC-gGh"/> +                </viewController> +                <placeholder placeholderIdentifier="IBFirstResponder" id="2Uy-KG-psE" userLabel="First Responder" sceneMemberID="firstResponder"/> +            </objects> +            <point key="canvasLocation" x="1855" y="1288"/> +        </scene> +        <!--Threshold View Controller - Threshold--> +        <scene sceneID="Z2f-rf-6sX"> +            <objects> +                <tableViewController id="0Fo-5M-9Kc" customClass="ThresholdViewController" sceneMemberID="viewController"> +                    <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="singleLineEtched" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="X8h-db-Tyy"> +                        <rect key="frame" x="0.0" y="64" width="320" height="455"/> +                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> +                        <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> +                        <sections> +                            <tableViewSection headerTitle="Name" id="rw6-Jb-4uv"> +                                <cells> +                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="YJO-87-xho"> +                                        <rect key="frame" x="0.0" y="46" width="320" height="46"/> +                                        <autoresizingMask key="autoresizingMask"/> +                                        <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> +                                            <rect key="frame" x="10" y="1" width="300" height="43"/> +                                            <autoresizingMask key="autoresizingMask"/> +                                            <subviews> +                                                <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="nJO-Vo-PIR"> +                                                    <constraints> +                                                        <constraint firstAttribute="width" constant="260" id="XOl-1f-qtC"/> +                                                        <constraint firstAttribute="height" constant="30" id="nXA-Jn-d5M"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/> +                                                    <textInputTraits key="textInputTraits" returnKeyType="done"/> +                                                </textField> +                                            </subviews> +                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> +                                        </view> +                                        <constraints> +                                            <constraint firstItem="nJO-Vo-PIR" firstAttribute="centerX" secondItem="YJO-87-xho" secondAttribute="centerX" type="default" id="Uor-sR-eAe"/> +                                            <constraint firstItem="nJO-Vo-PIR" firstAttribute="centerY" secondItem="YJO-87-xho" secondAttribute="centerY" type="default" id="mds-wZ-jBc"/> +                                        </constraints> +                                    </tableViewCell> +                                </cells> +                            </tableViewSection> +                            <tableViewSection headerTitle="Configuration" id="91l-NS-y54"> +                                <cells> +                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="esq-ii-fKo"> +                                        <rect key="frame" x="0.0" y="138" width="320" height="45"/> +                                        <autoresizingMask key="autoresizingMask"/> +                                        <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> +                                            <rect key="frame" x="10" y="1" width="300" height="43"/> +                                            <autoresizingMask key="autoresizingMask"/> +                                            <subviews> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Value" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uLA-H4-Ds7"> +                                                    <constraints> +                                                        <constraint firstAttribute="width" constant="158" id="hTo-AL-kb1"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/> +                                                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Threshold value" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dth-cf-hBc"> +                                                    <constraints> +                                                        <constraint firstAttribute="height" constant="21" id="C26-OZ-vR9"/> +                                                    </constraints> +                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/> +                                                    <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                                <stepper opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="100" translatesAutoresizingMaskIntoConstraints="NO" id="FfU-8X-ael"/> +                                            </subviews> +                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> +                                        </view> +                                        <constraints> +                                            <constraint firstItem="FfU-8X-ael" firstAttribute="leading" secondItem="Dth-cf-hBc" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="636-n4-B2q"/> +                                            <constraint firstItem="uLA-H4-Ds7" firstAttribute="leading" secondItem="esq-ii-fKo" secondAttribute="leading" constant="30" id="DIP-I3-VnA"/> +                                            <constraint firstItem="FfU-8X-ael" firstAttribute="centerY" secondItem="esq-ii-fKo" secondAttribute="centerY" type="default" id="M4j-y1-MBP"/> +                                            <constraint firstItem="FfU-8X-ael" firstAttribute="leading" secondItem="uLA-H4-Ds7" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="Qy8-WK-u8a"/> +                                            <constraint firstItem="Dth-cf-hBc" firstAttribute="top" secondItem="esq-ii-fKo" secondAttribute="top" constant="21" id="TKp-lA-dqZ"/> +                                            <constraint firstItem="Dth-cf-hBc" firstAttribute="leading" secondItem="uLA-H4-Ds7" secondAttribute="leading" type="default" id="fXH-Z3-iqc"/> +                                            <constraint firstItem="uLA-H4-Ds7" firstAttribute="top" secondItem="esq-ii-fKo" secondAttribute="top" constant="3" id="jBA-ob-FJM"/> +                                        </constraints> +                                    </tableViewCell> +                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="4Bb-Xx-rYH"> +                                        <rect key="frame" x="0.0" y="183" width="320" height="45"/> +                                        <autoresizingMask key="autoresizingMask"/> +                                        <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> +                                            <rect key="frame" x="10" y="0.0" width="300" height="43"/> +                                            <autoresizingMask key="autoresizingMask"/> +                                            <subviews> +                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Active" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zFB-iB-raY"> +                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/> +                                                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> +                                                    <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> +                                                </label> +                                                <switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sja-Le-4gL"/> +                                            </subviews> +                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> +                                        </view> +                                        <constraints> +                                            <constraint firstItem="zFB-iB-raY" firstAttribute="leading" secondItem="4Bb-Xx-rYH" secondAttribute="leading" constant="30" id="GOc-ML-UJx"/> +                                            <constraint firstItem="sja-Le-4gL" firstAttribute="top" secondItem="4Bb-Xx-rYH" secondAttribute="top" constant="8" id="jLs-Zh-kwh"/> +                                            <constraint firstAttribute="trailing" secondItem="sja-Le-4gL" secondAttribute="trailing" constant="30" id="o95-mR-xQJ"/> +                                            <constraint firstItem="sja-Le-4gL" firstAttribute="centerY" secondItem="zFB-iB-raY" secondAttribute="centerY" type="default" id="v08-bE-f3I"/> +                                        </constraints> +                                    </tableViewCell> +                                </cells> +                            </tableViewSection> +                        </sections> +                        <connections> +                            <outlet property="dataSource" destination="0Fo-5M-9Kc" id="b9C-em-A9Q"/> +                            <outlet property="delegate" destination="0Fo-5M-9Kc" id="OJX-5y-Ewk"/> +                        </connections> +                    </tableView> +                    <navigationItem key="navigationItem" title="Threshold" id="Ozv-hq-I7e"> +                        <barButtonItem key="rightBarButtonItem" systemItem="save" id="cAv-1a-lwW"/> +                    </navigationItem> +                </tableViewController> +                <placeholder placeholderIdentifier="IBFirstResponder" id="x2h-49-oUN" userLabel="First Responder" sceneMemberID="firstResponder"/> +            </objects> +            <point key="canvasLocation" x="2278" y="1288"/> +        </scene>          <!--Navigation Controller - iBean-->          <scene sceneID="Omk-M9-1jr">              <objects> @@ -166,7 +529,7 @@                  </navigationController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="BKj-BM-fs1" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="755" y="403"/> +            <point key="canvasLocation" x="773" y="-153"/>          </scene>          <!--Bean Collection Info View Controller - Information (1/3)-->          <scene sceneID="zCd-OM-l6j"> @@ -258,7 +621,7 @@                  </viewController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="m7P-Kh-vW4" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="2247" y="403"/> +            <point key="canvasLocation" x="2265" y="-153"/>          </scene>          <!--Bean Collection Bean List View Controller - Beans (2/3)-->          <scene sceneID="A7y-oP-a8Z"> @@ -338,7 +701,7 @@                  </viewController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="BhV-Dk-tNN" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="2777" y="403"/> +            <point key="canvasLocation" x="2795" y="-153"/>          </scene>          <!--Edit Bean View Controller - Edit bean-->          <scene sceneID="Uz1-1o-7sM"> @@ -440,7 +803,7 @@                  </viewController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="WEn-wW-jac" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="3314" y="744"/> +            <point key="canvasLocation" x="3332" y="188"/>          </scene>          <!--Extraction View Controller - Extraction (3/3)-->          <scene sceneID="HiW-Hk-DPa"> @@ -494,7 +857,7 @@                  </viewController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="xVN-NA-gLQ" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="4498" y="403"/> +            <point key="canvasLocation" x="4516" y="-153"/>          </scene>          <!--Add Bean View Controller-->          <scene sceneID="w0g-Bq-kR5"> @@ -612,7 +975,7 @@                  </viewController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="myk-um-Owg" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="3314" y="31"/> +            <point key="canvasLocation" x="3332" y="-525"/>          </scene>          <!--Navigation Controller-->          <scene sceneID="kQ1-YP-ELW"> @@ -631,7 +994,7 @@                  </navigationController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="ikF-7S-dhL" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="1749" y="403"/> +            <point key="canvasLocation" x="1767" y="-153"/>          </scene>          <!--Bean Collection Extraction View Controller-->          <scene sceneID="FPd-MK-Ops"> @@ -785,7 +1148,26 @@                  </viewController>                  <placeholder placeholderIdentifier="IBFirstResponder" id="ZA6-Ra-Cp0" userLabel="First Responder" sceneMemberID="firstResponder"/>              </objects> -            <point key="canvasLocation" x="1285" y="1120"/> +            <point key="canvasLocation" x="777" y="564"/> +        </scene> +        <!--Navigation Controller - Settings--> +        <scene sceneID="zzz-XS-En2"> +            <objects> +                <navigationController id="A4w-PM-KKG" sceneMemberID="viewController"> +                    <tabBarItem key="tabBarItem" title="Settings" id="PWm-sv-T3a"/> +                    <toolbarItems/> +                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="qdu-XP-0k9"> +                        <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> +                        <autoresizingMask key="autoresizingMask"/> +                    </navigationBar> +                    <nil name="viewControllers"/> +                    <connections> +                        <segue destination="kQZ-wX-3ix" kind="relationship" relationship="rootViewController" id="9ZN-ST-jT1"/> +                    </connections> +                </navigationController> +                <placeholder placeholderIdentifier="IBFirstResponder" id="Vr2-tO-gZ9" userLabel="First Responder" sceneMemberID="firstResponder"/> +            </objects> +            <point key="canvasLocation" x="773" y="1288"/>          </scene>      </scenes>      <classes> @@ -890,6 +1272,32 @@          <class className="NSLayoutConstraint" superclassName="NSObject">              <source key="sourceIdentifier" type="project" relativePath="./Classes/NSLayoutConstraint.h"/>          </class> +        <class className="SettingsViewController" superclassName="UITableViewController"> +            <source key="sourceIdentifier" type="project" relativePath="./Classes/SettingsViewController.h"/> +            <relationships> +                <relationship kind="action" name="countExtractionsSwitchChanged:"/> +                <relationship kind="action" name="extractionCountStepperChanged:"/> +                <relationship kind="action" name="useThresholdsSwitchChanged:"/> +                <relationship kind="outlet" name="countExtractionsSwitch" candidateClass="UISwitch"/> +                <relationship kind="outlet" name="extractionCountLabel" candidateClass="UILabel"/> +                <relationship kind="outlet" name="extractionCountStepper" candidateClass="UIStepper"/> +                <relationship kind="outlet" name="useThresholdsSwitch" candidateClass="UISwitch"/> +            </relationships> +        </class> +        <class className="ThresholdCell" superclassName="UITableViewCell"> +            <source key="sourceIdentifier" type="project" relativePath="./Classes/ThresholdCell.h"/> +            <relationships> +                <relationship kind="outlet" name="enabledSwitch" candidateClass="UISwitch"/> +                <relationship kind="outlet" name="nameLabel" candidateClass="UILabel"/> +                <relationship kind="outlet" name="valueLabel" candidateClass="UILabel"/> +            </relationships> +        </class> +        <class className="ThresholdListViewController" superclassName="UIViewController"> +            <source key="sourceIdentifier" type="project" relativePath="./Classes/ThresholdListViewController.h"/> +        </class> +        <class className="ThresholdViewController" superclassName="UITableViewController"> +            <source key="sourceIdentifier" type="project" relativePath="./Classes/ThresholdViewController.h"/> +        </class>      </classes>      <simulatedMetricsContainer key="defaultSimulatedMetrics">          <simulatedStatusBarMetrics key="statusBar"/> @@ -897,7 +1305,8 @@          <simulatedScreenMetrics key="destination" type="retina4"/>      </simulatedMetricsContainer>      <inferredMetricsTieBreakers> +        <segue reference="EsA-2d-QNt"/> +        <segue reference="CyX-df-8ge"/>          <segue reference="utz-eo-nc3"/> -        <segue reference="OPZ-Pj-2Dz"/>      </inferredMetricsTieBreakers>  </document>
\ No newline at end of file | 
