Today's Menu  Portugal
journal and plan nutrition
Z3DateTimeFocusView.m
Go to the documentation of this file.
1 //
2 // Z3DateTimeFocusView.m
3 // TodaysMenu
4 //
5 // Created by Don Zeek on 4/17/17.
6 // Copyright © 2017 net.dzeek.y2015.ios.portfolio. All rights reserved.
7 //
8 
9 #import "Z3DateTimeFocusView.h"
10 #import "Z5DataController.h"
11 
12 @implementation Z3DateTimeFocusView {
13  NSDateFormatter *mDateFormatter;
14  id<Z3DateTimeFocusDelegate> focusDelegate;
15  UIButton *dateButton;
16 }
17 
18 - (instancetype) initWithFrame:(CGRect)frame andDelegate:(id<Z3DateTimeFocusDelegate>)delegate
19 {
20  self = [super initWithFrame:frame];
21  if (self) {
23 
24  NSLog(@"DateTimeFocusView.initWithFrameAndDelegate: frame height: %3.2f", frame.size.height);
25  CGRect dateButtonFrame = CGRectMake(1, 1, frame.size.width - 2.0, 30);
26  dateButton = [[UIButton alloc] initWithFrame:dateButtonFrame];
27  [dateButton setBackgroundColor:[UIColor greenColor]];
28  [dateButton addTarget:self action:@selector(clickTopBar) forControlEvents:UIControlEventTouchDown];
29  [self addSubview:dateButton];
30  }
31  return self;
32 }
33 - (void) clickTopBar
34 {
35  NSLog(@"DateTimeFocusView.clickTopBar");
36  [focusDelegate clickAction];
37 }
38 - (float) heightRequirement
39 {
40  float ret = 36.0;
41  return ret;
42 }
43 - (void) appear:(CGRect)bound
44 {
45  NSLog(@"DateTimeFocusView.appear: labelCaption: %@", _labelCaption);
46  if (!_labelCaption) {
47  _labelCaption = @"Happy for now";
48  }
49  [self setBackgroundColor:[[Z5DataController sharedInstance] grapeSkinDeepPurple]];
50 
51  [Z5DataController labelizeButton:dateButton withText:_labelCaption];
52 }
53 
54 /*
55 // Only override drawRect: if you perform custom drawing.
56 // An empty implementation adversely affects performance during animation.
57 - (void)drawRect:(CGRect)rect {
58  // Drawing code
59 }
60 */
61 
62 @end
instancetype sharedInstance()
NSDateFormatter * mDateFormatter
UIButton * dateButton
id< U7ParamEditControlDelegate > delegate
Singleton interface to both core and remote data sources.
void labelizeButton:withText:(UIButton *targButton, [withText] NSString *txt)
id< Z3DateTimeFocusDelegate > focusDelegate