Today's Menu  Portugal
journal and plan nutrition
Instance Methods | Properties | List of all members
P2SnapMealEntryViewController Class Reference

#import <P2SnapMealEntryViewController.h>

Inheritance diagram for P2SnapMealEntryViewController:
Inheritance graph
[legend]
Collaboration diagram for P2SnapMealEntryViewController:
Collaboration graph
[legend]

Instance Methods

(void) - viewDidLoad [implementation]
 
(void) - reviewComplete [implementation]
 

Properties

id< P2SnapMealInfoProtocol > mealDelegate
 
UIImage * focusImage
 
MealfocusMeal
 

Detailed Description

Definition at line 14 of file P2SnapMealEntryViewController.h.

Method Documentation

◆ reviewComplete()

- (void) reviewComplete
implementation

Definition at line 58 of file P2SnapMealEntryViewController.m.

59 {
60  NSLog(@"P2SnapMealEntryViewController.reviewComplete");
61 
62  //
63  [_mealDelegate reviewComplete];
64 
65  // [self dismissViewControllerAnimated:NO completion:nil];
66  [self.navigationController popViewControllerAnimated:NO];
67 }

◆ viewDidLoad()

- (void) viewDidLoad
implementation

Definition at line 23 of file P2SnapMealEntryViewController.m.

23  {
24  [super viewDidLoad];
25  // Do any additional setup after loading the view.
26  self.title = @"Snap Meal Captioning";
27  [self.view setBackgroundColor:[UIColor colorWithHue:0.27 saturation:0.5 brightness:0.7 alpha:1.0]];
28 
29  // topOfPage, imageHeight, featuresWidth,
30  // and sideMarginWidth are class vars
31  CGRect totalFrame = self.view.frame;
32  CGRect topNavigationFrame = [[[self navigationController] navigationBar] frame];
33  // CGSize buttonSize = CGSizeMake(totalFrame.size.width * 0.42, 40.0);
34 
35  topOfPageFloat = topNavigationFrame.origin.y + topNavigationFrame.size.height;
36  featuresWidthFloat = totalFrame.size.width - 16;
37  float featureHeight = totalFrame.size.height - topOfPageFloat - 16;;
38  // sideMarginWidth = [[NSNumber alloc] initWithFloat:sideMarginWidthFloat];
39 
40  // get and scale image for background
41  UIImage *backgrdImage = [UIImage imageNamed:@"coffeecakeBackground.png"];
42  CGSize photoSize = [backgrdImage size];
43  float resizeRatio = photoSize.height / totalFrame.size.height;
44  UIImage *resizedImage = [UIImage imageWithCGImage:[backgrdImage CGImage]
45  scale:backgrdImage.scale * resizeRatio
46  orientation:(backgrdImage.imageOrientation) ];
47  UIImageView *backgrd = [[UIImageView alloc] initWithImage:resizedImage];
48  [self.view addSubview:backgrd];
49  // end - get and scale image for background
50 
51  // create section 0 header and footer views
52  CGRect mealViewFrame = CGRectMake(4, topOfPageFloat+4, featuresWidthFloat, featureHeight);
53  // P2SnapMealInfoView *mealView = [[P2SnapMealInfoView alloc] initWithImage:_focusImage inFrame:mealViewFrame delegate:self];
54  P2SnapMealInfoView *mealView = [[P2SnapMealInfoView alloc] initWithMeal:_focusMeal inFrame:mealViewFrame delegate:self];
55  [self.view addSubview:mealView];
56 }
float featuresWidthFloat

Property Documentation

◆ focusImage

- (UIImage*) focusImage
readwritenonatomicstrong

Definition at line 17 of file P2SnapMealEntryViewController.h.

◆ focusMeal

- (Meal*) focusMeal
readwritenonatomicstrong

Definition at line 18 of file P2SnapMealEntryViewController.h.

◆ mealDelegate

- (id<P2SnapMealInfoProtocol>) mealDelegate
readwritenonatomicstrong

Definition at line 16 of file P2SnapMealEntryViewController.h.


The documentation for this class was generated from the following files: