Today's Menu  Portugal
journal and plan nutrition
Z6ParamValueEditView.m
Go to the documentation of this file.
1 //
2 // Z6ParamValueEditView.m
3 // TodaysMenu
4 //
5 // Created by Don Zeek on 3/25/17.
6 // Copyright © 2017 net.dzeek.y2015.ios.portfolio. All rights reserved.
7 //
8 #import <HealthKit/HealthKit.h>
9 
10 #import "Z5DataController.h"
11 #import "Z6ParamValueEditView.h"
13 
14 @implementation Z6ParamValueEditView {
15  id<Z6ParamValueEditDelegate> delegate;
16  UIPickerView *newParameterPicker;
18  NSMutableArray *nutritionComponents;
19  NSInteger newParameterIndex;
24 }
26 HKQuantityType *pickQuantityType;
28 
29 HKQuantityType *pickQuantityType;
31 NSArray *massUnitsArray;
32 int massUnitsMetricPrefixArray[] = { HKMetricPrefixMicro, HKMetricPrefixMilli, HKMetricPrefixNone, HKMetricPrefixKilo};
34 int energyUnitsMetricPrefixArray[] = {HKMetricPrefixNone, HKMetricPrefixKilo};
35 NSMutableArray *pickerWheel4Titles;
36 
38 NSMutableDictionary *newComponentSpecDict;
39 
44 - (instancetype) initWithDelegate: (id<Z6ParamValueEditDelegate>) dele {
45  self = [super init];
46  if (self) {
47  delegate = dele;
48  [self originate];
49  }
50  return self;
51 }
52 - (void) originate
53 {
54  // [self setBackgroundColor:[UIColor cyanColor]];
55 
56  sideMarginWidth = 2.0;
57  topOfPickerFrame= 2.0;
62  pickerWheel4Titles = nil;
63  massUnitsArray = [[NSArray alloc] initWithObjects: @"ug", @"mg", @"g", @"kg", nil];
64  energyUnitsArray = [[NSArray alloc] initWithObjects: @"cal", @"kcal", nil];
65 
66  CGRect totalFrame = delegate.screenBound;
67  featuresWidth = 260;
68  // newParameterPickerHeight = totalFrame.size.height * 0.20 ;
69  featuresWidth = totalFrame.size.width - 4.0;
70 
71  CGRect newParameterFrame = CGRectMake(2.0, 2.0, 400.0, 350.0);
72  newParameterPicker = [[UIPickerView alloc] initWithFrame:newParameterFrame];
73  [newParameterPicker setDelegate:self];
74  [newParameterPicker setDataSource:self];
75  [newParameterPicker setBackgroundColor:[UIColor colorWithWhite:0.76 alpha:1.0]];
76  [self addSubview:newParameterPicker];
77 }
78 
79 
87 - (void) showPickerViewNot: (Boolean) flag
88 {
89  UIColor *okGreen = [UIColor colorWithHue:0.345
90  saturation:1.0
91  brightness:0.7
92  alpha:1.0];
93  [newParameterPicker setBackgroundColor:okGreen];
94  // [newParameterPicker setDataSource:self];
95  // [newParameterPicker setDelegate:self];
96 
97  [newParameterPicker setHidden:!flag];
98 }
103 - (void) initializeSelection
104 {
106 }
110 - (void) specializePickerView: (NSDictionary *) editSource
111 {
112  NSLog(@"ParameterValueEditView.specializePickerView: editSource: %@", editSource);
113 
114  // RESTART HERE
115  // at this point, get the index of the name match, and set 'newParameterIndex'
116  NSString *incomingName = [editSource objectForKey:@"component-type"];
117  for (NSInteger parameterCardinal = 0; parameterCardinal<39; parameterCardinal++) {
118  NSString *entryName = [self stringForPickerRow:parameterCardinal];
119  if ([entryName isEqualToString:incomingName]) {
120  newParameterIndex = parameterCardinal;
121  break;
122  }
123  }
124 
125  if ( !editParameterSelected ) {
126  editParameterSelected = YES;
127  [newParameterPicker reloadAllComponents];
128  // i must set pickQuantityType and picQuantityUnit here
129  [self establishPick:newParameterIndex];
130  [newParameterPicker selectRow:newParameterIndex inComponent:0 animated:YES];
131 
132  [self setupDimensionWheel];
133  }
134 
135  [self showPickerViewNot:YES];
136 
137  NSString *caption = [editSource objectForKey:[Z5LocalDataController componentNameKey]];
138  HKQuantityType *rowQuantityType = [HKObjectType quantityTypeForIdentifier:[@"HKQuantityTypeIdentifierDietary"
139  stringByAppendingString:caption]];
140 
141  HKQuantity *componentQuanValue = [editSource objectForKey:[Z5LocalDataController componentValueKey]];
142  NSString *valueCaption = [componentQuanValue description];
143  NSArray<NSString *> *pieces = [valueCaption componentsSeparatedByString:@" "];
144  HKUnit *hkUnit = nil;
145  float quantityScalar = [pieces[0] floatValue];
146  if ([@"mcg" isEqualToString:pieces[1]]) {
147  HKMetricPrefix microPrefix = HKMetricPrefixMicro;
148  hkUnit = [HKUnit gramUnitWithMetricPrefix:microPrefix];
149  } else if ([@"mg" isEqualToString:pieces[1]]) {
150  HKMetricPrefix milliPrefix = HKMetricPrefixMilli;
151  hkUnit = [HKUnit gramUnitWithMetricPrefix:milliPrefix];
152  }
153  // HKQuantity *hkQuantity = [HKQuantity quantityWithUnit:hkUnit doubleValue:quantityScalar];
154 
155  // [self setPickerType:rowQuantityType andQuantity:hkQuantity];
156  int intScalar = (int)quantityScalar;
157  [self setPickerType:rowQuantityType scalar:intScalar andUnit:pieces[1]];
158 
159 }
160 
164 - (HKQuantity *) produceQuantityValue
165 {
166  // amount
167  NSInteger hundreds = [newParameterPicker selectedRowInComponent:1];
168  NSInteger tens = [newParameterPicker selectedRowInComponent:2];
169  NSInteger ones = [newParameterPicker selectedRowInComponent:3];
170  double inputValue = 100*hundreds + 10*tens + ones;
171  double nutritionAmount = inputValue; // = pickerValue;
172  // END -- amount
173 
174  // units
175  NSUInteger unitIndex = [newParameterPicker selectedRowInComponent:4];
176  // NSString *units = [pickerWheel4Titles objectAtIndex:unitIndex];
177  HKUnit *massUnit = [HKUnit unitFromString:@"g"];
178  HKUnit *energyUnit = [HKUnit unitFromString:@"cal"];
179  HKMetricPrefix metricPrefix;
180  HKQuantity *acceptQuantity;
181  if ([pickQuantityType isCompatibleWithUnit:massUnit]) {
182  metricPrefix = massUnitsMetricPrefixArray[unitIndex];
183  HKUnit *prefixGramUnit = [HKUnit gramUnitWithMetricPrefix:metricPrefix];
184  acceptQuantity = [HKQuantity quantityWithUnit:prefixGramUnit doubleValue:nutritionAmount];
185  } else if ([pickQuantityType isCompatibleWithUnit:energyUnit]) {
186  switch(unitIndex) {
187  case 0:
188  acceptQuantity = [HKQuantity quantityWithUnit:[HKUnit calorieUnit] doubleValue:nutritionAmount];
189  break;
190  case 1:
191  acceptQuantity = [HKQuantity quantityWithUnit:[HKUnit calorieUnit] doubleValue:nutritionAmount];
192  break;
193  }
194  }
195  // END -- units
196 
197  NSLog(@"Z6ParamValueEditView.clickAcceptButton: quantity: %@", acceptQuantity);
198  return acceptQuantity;
199 }
200 
204 - (NSDictionary *) originateParameter
205 {
206  HKQuantity *acceptQuantity = [self produceQuantityValue];
207  [newComponentSpecDict setObject:acceptQuantity forKey:[Z5LocalDataController componentValueKey]];
208 
209  // https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HealthKit_Constants/index.html#//apple_ref/doc/constant_group/Nutrition_Identifiers
210  // HKQuantityType *acceptedQuantityType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierDietarySodium];
211  // [acceptedQuantityType.canonicalUnit]
212 
213  NSDate *now = [NSDate dateWithTimeIntervalSinceNow:0];
214  HKQuantitySample *acceptedSample = [HKQuantitySample quantitySampleWithType:pickQuantityType
215  quantity:acceptQuantity
216  startDate:now
217  endDate:now];
218  [newComponentSpecDict setObject:acceptedSample forKey:[Z5LocalDataController componentSampleKey]];
219 
220  Z5LocalDataController *localData = [[Z5DataController sharedInstance] localDataController];
221  NSNumber *typeAuthorization = [localData checkTypeAuthorization:pickQuantityType];
222  [newComponentSpecDict setObject:typeAuthorization forKey:[Z5LocalDataController componentAuthorityKey]];
223  return newComponentSpecDict;
224 }
225 #pragma mark - Z6ContainedView
226 
230 - (float) heightRequirement
231 {
232  return newParameterPickerHeight + 4;
233 }
237 - (void) appear:(CGRect)bound
238 {
239  // NSLog(@"Z6ParamValueEditView.appear: newParameterPickerHeight: %3.2f", newParameterPickerHeight);
240  switch ([delegate getTotalEditState]) {
241  case INITIAL_STATE:
242  {
243  }
244  break;
245  case PICK_COMPONENT:
246  {
247  }
248  break;
249  case PICK_QUANTITY:
250  {
251  // next line is inadequate, consider when parameter
252  // added subsequent to initial add. Name inside dictionary
253  // should be new parameter, or selected parameter GENERally
254  // from component-0
255  NSInteger huh = [newParameterPicker selectedRowInComponent:0];
256  NSString *component0parameter = [self stringForPickerRow:huh];
257  NSDictionary *tryThisDict = [[NSDictionary alloc] initWithObjectsAndKeys:component0parameter, [Z5LocalDataController componentNameKey] , nil];
258  NSDictionary *editParameterDictionary = [delegate selectedParameterList];
259  if (editParameterDictionary && ([editParameterDictionary count] > 0)) {
260  [self specializePickerView:editParameterDictionary];
261  } else {
262  [self specializePickerView:tryThisDict];
263  }
264  }
265  break;
266  }
267  CGRect pickerFrame = CGRectMake(2.0, 2.0, bound.size.width - 4.0, newParameterPickerHeight);
268  [newParameterPicker setFrame:pickerFrame];
269  [newParameterPicker showsSelectionIndicator];
270 }
271 
272 #pragma mark - UIPickerViewDelegate
273 
276 - (CGFloat)pickerView:(UIPickerView *)pickerView
277 rowHeightForComponent:(NSInteger)component
278 {
279  CGFloat ret;
280  ret = 30.0;
281  return ret;
282 }
286 - (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component
287 {
288  CGFloat ret;
289  switch (component) {
290  case 0:
291  {
292  if ( editParameterSelected ) {
293  ret = 100.0;
294  } else {
295  ret = 300;
296  }
297  }
298  break;
299 
300  case 1:
301  case 2:
302  case 3:
303  ret = 22.0;
304  break;
305 
306  case 4:
307  ret = 70.0f;
308  break;
309 
310  default:
311  ret=0;
312  break;
313  }
314 
315  // NSLog(@"Z6ParamValueEditView.widthForComponent: %3.2f", ret);
316  return ret;
317 }
318 
319 - (NSAttributedString *)pickerView:(UIPickerView *)pickerView
320  attributedTitleForRow:(NSInteger)row
321  forComponent:(NSInteger)component
322 {
323  NSString *ret;
324 
325  if (0 == component) {
326  ret = [self stringForPickerRow:row];
327  // NSLog(@"/Z6ParamValueEditView.titleForRow: %ld: %@", row, ret);
328  } else if (1 == component) {
329  ret = [[NSString alloc] initWithFormat:@"%ld", (long)row];
330  } else if (2 == component) {
331  ret = [[NSString alloc] initWithFormat:@"%ld", (long)row];
332  } else if (3 == component) {
333  ret = [[NSString alloc] initWithFormat:@"%ld", (long)row];
334  } else if (4 == component) {
335  // ret = [self parameterDimensionForRow:row];
336  if ([pickerWheel4Titles count] > row) {
337  ret = [pickerWheel4Titles objectAtIndex:row];
338  } else {
339  ret = @"w?5";
340  }
341  } else {
342  NSLog(@"Z6ParamValueEditView.titleForRow: unknown component: %ld", (long)component);
343  }
344 
345  UIFont *herefont = [UIFont fontWithName:@"Helvetica-Bold" size:16];
346  NSDictionary *attribs = @{
347  NSForegroundColorAttributeName: [UIColor blackColor],
348  NSFontAttributeName: herefont
349  };
350  NSMutableAttributedString *attributedText =
351  [[NSMutableAttributedString alloc] initWithString:ret
352  attributes:attribs];
353  return attributedText;
354 }
355 -(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
356 {
357  // create attributed string
358  NSString *ret;
359 
360  if (0 == component) {
361  ret = [self stringForPickerRow:row];
362  NSLog(@"Z6ParamValueEditView.titleForRow: %ld: %@", (long)row, ret);
363  } else if (1 == component) {
364  ret = [[NSString alloc] initWithFormat:@"%ld", (long)row];
365  } else if (2 == component) {
366  ret = [[NSString alloc] initWithFormat:@"%ld", (long)row];
367  } else if (3 == component) {
368  ret = [[NSString alloc] initWithFormat:@"%ld", (long)row];
369  } else if (4 == component) {
370  // ret = [self parameterDimensionForRow:row];
371  if ([pickerWheel4Titles count] > row) {
372  ret = [pickerWheel4Titles objectAtIndex:row];
373  } else {
374  ret = @"x?v";
375  }
376  } else {
377  NSLog(@"Z6ParamValueEditView.titleForRow: unknown component: %ld", (long)component);
378  }
379 
380  UIFont *herefont = [UIFont fontWithName:@"Helvetica-Bold" size:20];
381  NSDictionary *attribs = @{
382  NSForegroundColorAttributeName: [UIColor blackColor],
383  NSFontAttributeName: herefont
384  };
385  NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:ret attributes:attribs];
386 
387  // add the string to a label's attributedText property
388  UILabel *labelView = [[UILabel alloc] init];
389  [labelView setTextAlignment:NSTextAlignmentCenter];
390  labelView.attributedText = attributedString;
391 
392  // return the label
393  return labelView;
394 }
395 - (NSInteger) isListedAlready: (NSString *)pickedCaption
396 {
397  NSInteger ret = -1;
398  int parameterIndex = 0;
399  for (NSDictionary *item in nutritionComponents) {
400  NSString *componentType = [item objectForKey:[Z5LocalDataController componentNameKey]];
401  NSString *compoTypeClass = NSStringFromClass([componentType class]);
402 
403  if ([compoTypeClass isEqualToString:@"NSTaggedPointerString"]) {
404  //U7UsdaParamEntryViewController.m:690:45: Use of undeclared identifier 'NSTaggedPointerString', even with UIKit.
405  // NSTaggedPointerString *tpStr = (NSTaggedPointerString *)componentType;
406  if ([componentType isEqualToString:pickedCaption]) {
407  NSLog(@"Z6ParamValueEditView.isListedAlready: UNEXPECTED: %@", componentType);
408  ret = parameterIndex;
409  }
410  break;
411  } else if (![compoTypeClass isEqualToString:@"NSString"]) {
412  NSLog(@"Z6ParamValueEditView.isListedAlready: odd-bal compo-class: %@", compoTypeClass);
413  } else if ([componentType isEqualToString:pickedCaption]) {
414  // if component is listed, eventually set the picker view
415  // to the quantity-sample data
416  ret = parameterIndex;
417  break;
418  }
419  parameterIndex++;
420  }
421  return ret;
422 }
430 - (void) setupDimensionWheel
431 {
432  // [newParameterPicker selectRow:row inComponent:4 animated:YES];
433 
434  pickerWheel4Titles = nil;
436  HKUnit *massUnit = [HKUnit unitFromString:@"g"];
437  HKUnit *energyUnit = [HKUnit unitFromString:@"cal"];
438  if ([pickQuantityType isCompatibleWithUnit:massUnit]) {
439  pickerWheel4Titles = [[NSMutableArray alloc] initWithArray:massUnitsArray];
440  } else if ([pickQuantityType isCompatibleWithUnit:energyUnit]) {
441  pickerWheel4Titles = [[NSMutableArray alloc] initWithArray:energyUnitsArray];
442  }
443  }
444  NSLog(@"Z6ParamValueEditView.setupDimensionWheel: count: %ld", (long)[pickerWheel4Titles count]);
445 }
446 - (HKUnit *) unitForQuantityType: (HKQuantityType *)quantityType
447 {
448  // for each unit type, is it compatible with input?
449  HKUnit *ret = nil;
450  NSArray<HKUnit *> *unitsAvailable = [[NSArray alloc] initWithObjects: [HKUnit gramUnit],
451  [HKUnit meterUnit], [HKUnit literUnit], [HKUnit pascalUnit], [HKUnit secondUnit],
452  [HKUnit jouleUnit] , [HKUnit degreeCelsiusUnit], [HKUnit siemenUnit], nil];
453  for (HKUnit *u in unitsAvailable) {
454  if ([quantityType isCompatibleWithUnit:u]) {
455  ret = u;
456  break;
457  }
458  }
459  return ret;
460 }
461 
468 - (void) establishPick: (NSInteger)row
469 {
470  NSString *pickedCaption = [self stringForPickerRow:row];
471  NSInteger valueComponentIndex = 1;
472  [newParameterPicker reloadComponent:valueComponentIndex];
473  valueComponentIndex = 2;
474  [newParameterPicker reloadComponent:valueComponentIndex];
475  valueComponentIndex = 3;
476  [newParameterPicker reloadComponent:valueComponentIndex];
477  valueComponentIndex = 4;
478  [newParameterPicker reloadComponent:valueComponentIndex];
479 
480  newComponentSpecDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:pickedCaption, [Z5LocalDataController componentNameKey], nil];
481 
482  // TODO [editControlbarView showPickOptions];
483 
484  pickQuantityType = [HKObjectType quantityTypeForIdentifier:[[[[Z5DataController sharedInstance] localDataController] availableNutritionParamArray] objectAtIndex:row]];
485  pickQuantityUnit = [self unitForQuantityType:pickQuantityType];
486  NSLog(@"Z6ParamValueEditView.didSelectRow: pickQuantityUnit: %@", pickQuantityUnit);
487 
488 }
489 - (void)pickerView:(UIPickerView *)pickerView
490  didSelectRow:(NSInteger)row
491  inComponent:(NSInteger)component
492 {
493  NSLog(@"Z6ParamValueEditView.didSelectPickerRow: component: %ld", (long)component);
494  newParameterIndex = row;
495  switch (component) {
496  case 0:
497  {
498  // set the HKQuantityType with result
499  NSString *pickedCaption = [self stringForPickerRow:row];
500  NSLog(@"Z6ParamValueEditView.didSelectPickerRow: %ld %@", (long)row, pickedCaption);
501  int parameterIndex = (int)[self isListedAlready:pickedCaption];
502  // see if the quantity-type is already listed
503  if (0 <= parameterIndex) {
504  // TODO set scrolling
505  // NSIndexPath *paramComponentPath = [NSIndexPath indexPathForRow:parameterIndex inSection:0];
506  // [parameterTableView selectRowAtIndexPath:paramComponentPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
507  // NSLog(@"Z6ParamValueEditView.didSelectPickerRow: picking component row: %d", parameterIndex);
508  } else {
509  // if processing reaches this point, quantity-type not listed
510  if (editParameterSelected ) {
511  [self establishPick:row];
512  [self setupDimensionWheel];
513  } else {
515  NSLog(@"Z6ParamValueEditView.didSelectRow: reload all components at pick");
516  [pickerView reloadAllComponents];
517  NSLog(@"Z6ParamValueEditView.didSelectRow: END -- reload all components at pick");
518  }
520  }
521  }
522 
523  break;
524  case 1:
525  case 2:
526  case 3:
527  case 4:
528  {
529  NSLog(@"Z6ParamValueEditView.didSelectRow: component: %ld", (long)component);
530  }
531  break;
532  default:
533  break;
534  }
535 }
536 
537 #pragma mark - UIPickerViewDataSource
538 - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
539 {
540  NSInteger ret = 0;
541  if ( editParameterSelected ) {
542  ret = 5;
543  } else {
544  ret = 1;
545  }
546  return ret;
547 }
548 - (NSInteger)pickerView:(UIPickerView *)pickerView
549 numberOfRowsInComponent:(NSInteger)component
550 {
551  NSInteger ret = 0;
552  switch(component) {
553  case 0:
554  {
555  NSArray<HKQuantityType *> *typesApprovedToWrite = [[[Z5DataController sharedInstance] localDataController] allHkTypes];
556  ret = [typesApprovedToWrite count];
557  }
558  break;
559  case 1:
560  case 2:
561  case 3:
562  {
563  if ( !editParameterSelected ) {
564  ret = 0;
565  } else {
566  ret = 10;
567  }
568  }
569  break;
570 
571  case 4:
572  {
573  if ( !editParameterSelected ) {
574  ret = 0;
575  } else {
576  if (pickQuantityType) {
577  HKUnit *massUnit = [HKUnit unitFromString:@"g"];
578  HKUnit *energyUnit = [HKUnit unitFromString:@"cal"];
579  if ([pickQuantityType isCompatibleWithUnit:massUnit]) {
580  ret = 4;
581  } else if ([pickQuantityType isCompatibleWithUnit:energyUnit]) {
582  ret = 2;
583  }
584  } else {
585  ret = 4;
586  NSLog(@"Z6ParamValueEditView.numberOfRowsInComponent: NULL pickQuantityType");
587  }
588  }
589  }
590  break;
591 
592  default:
593  ret = 0;
594  }
595  return ret;
596 }
597 
598 #pragma mark - picker action
599 
600 // - (void) setPickerType:(HKQuantityType* )quanType andQuantity:(HKQuantity *)quantity
601 - (void) setPickerType:(HKQuantityType* )quanType scalar:(int)scalar andUnit:(NSString *)unit
602 {
603  NSArray *types = [[[Z5DataController sharedInstance] localDataController] availableNutritionParamArray];
604  int row = 0;
605  for (NSString *type in types) {
606  if ([type isEqualToString:[quanType description]]) {
607  // [newParameterPicker selectRow:row inComponent:0 animated:YES];
608  break;
609  }
610  row++;
611  }
612 
613  int hundreds = scalar / 100;
614  int tens = (scalar - (100*hundreds)) / 10;
615  int ones = scalar - (100*hundreds) - (10*tens);
616 
617  [newParameterPicker selectRow:hundreds inComponent:1 animated:YES];
618  [newParameterPicker selectRow:tens inComponent:2 animated:YES];
619  [newParameterPicker selectRow:ones inComponent:3 animated:YES];
620  NSLog(@"Z6ParamValueEditView.setPickerType");
621 }
622 
623 
624 - (NSString *) stringForPickerRow: (NSInteger) row
625 {
626  NSString *ret;
627  NSArray<HKQuantityType *> *typesApprovedToWrite = [[[Z5DataController sharedInstance] localDataController] allHkTypes];
628  if ([typesApprovedToWrite count] > row) {
629  HKQuantityType *hkQtype = [typesApprovedToWrite objectAtIndex:row];
630  ret = [[hkQtype description] substringFromIndex:31];
631  } else {
632  ret = @"error?";
633  }
634  return ret;
635 }
636 
637 /*
638  // Only override drawRect: if you perform custom drawing.
639  // An empty implementation adversely affects performance during animation.
640  - (void)drawRect:(CGRect)rect {
641  // Drawing code
642  }
643  */
644 
645 @end
int massUnitsMetricPrefixArray[]
void specializePickerView:(NSDictionary *editSource)
HKQuantity * produceQuantityValue()
NSMutableArray * pickerWheel4Titles
HKQuantityType * pickQuantityType
NSMutableArray * nutritionComponents
float newParameterPickerHeight
Boolean editParameterSelected
instancetype sharedInstance()
float featuresWidth
HKUnit * pickQuantityUnit
void setPickerType:scalar:andUnit:(HKQuantityType *quanType, [scalar] int scalar, [andUnit] NSString *unit)
float topOfPickerFrame
NSArray * massUnitsArray
NSInteger newParameterIndex
void establishPick:(NSInteger row)
id< U7ParamEditControlDelegate > delegate
NSMutableDictionary * newComponentSpecDict
NSString * stringForPickerRow:(NSInteger row)
NSArray * energyUnitsArray
HKUnit * unitForQuantityType:(HKQuantityType *quantityType)
NSNumber * checkTypeAuthorization:(HKQuantityType *quantityType)
Singleton interface to both core and remote data sources.
float sideMarginWidth
CGRect newParameterPickerFrame
NSInteger editNutritionParameter
int energyUnitsMetricPrefixArray[]
HKQuantityType * pickQuantityType
UIPickerView * newParameterPicker
void showPickerViewNot:(Boolean flag)