Repository navigation
Expand file tree
/
Copy pathHappySaveViewController.m
More file actions
executable file
·146 lines (112 loc) · 3.42 KB
/
Copy pathHappySaveViewController.m
File metadata and controls
executable file
·146 lines (112 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//
// HappySaveViewController.m
// iBeHappy
//
// Created by Jaroslaw Szymczyk on 12/22/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "HappySaveViewController.h"
//#import <Parse/Parse.h>
@interface HappySaveViewController ()
@end
@implementation HappySaveViewController
@synthesize profile;
@synthesize bloodVC;
@synthesize bioVC;
@synthesize homeVC;
@synthesize remVC;
@synthesize challengeVC;
@synthesize scoreVC;
@synthesize savingIndicator;
- (IBAction)Profile:(id)sender
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
if (nil == bioVC) {
bioVC = [storyboard instantiateViewControllerWithIdentifier:@"505"];
}
// viewDidLoad will be called
[self presentViewController:(UIViewController *)bioVC animated:YES completion:nil];
self.bioVC = nil;
}
- (IBAction)Home:(id)sender
{
if (nil == homeVC) {
homeVC = [[HappyHomeViewController alloc] initWithNibName:@"HappyHomeViewController"
bundle:nil];
}
// viewDidLoad will be called
[self presentViewController:homeVC animated:YES completion:nil];
self.homeVC = nil;
}
- (IBAction)Score:(id)sender
{
if (nil == scoreVC) {
scoreVC = [[HappyScoreViewController alloc] initWithNibName:@"HappyScoreViewController"
bundle:nil];
}
// viewDidLoad will be called
[self presentViewController:scoreVC animated:YES completion:nil];
self.scoreVC = nil;
}
- (IBAction)Challenge
{
savingIndicator.hidden = false;
[savingIndicator startAnimating];
if (nil == challengeVC) {
challengeVC = [[HappyChallengeViewController alloc] initWithNibName:@"HappyChallengeViewController"
bundle:nil];
}
challengeVC.profile = profile;
// viewDidLoad will be called
[self presentViewController:challengeVC animated:YES completion:nil];
//challengeVC.profile = profile;
self.challengeVC = nil;
}
- (IBAction)Reminders:(id)sender
{
if (nil == remVC) {
remVC = [[HappyRemindersViewController alloc] initWithNibName:@"HappyRemindersViewController"
bundle:nil];
}
remVC.profile = profile;
// viewDidLoad will be called
[self presentViewController:remVC animated:YES completion:nil];
self.remVC = nil;
}
- (IBAction)SaveAll:(id)sender
{
[Utility archiveProfile:profile];
profile.profileCompleted = true;
savingIndicator.hidden = false;
[savingIndicator startAnimating];
[self Challenge];
}
- (IBAction)GoBack:(id)sender {
[self.navigationController popViewControllerAnimated:YES];
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
savingIndicator.hidesWhenStopped = true;
[savingIndicator stopAnimating];
// Do any additional setup after loading the view.
}
- (void)viewDidUnload
{
[self setSavingIndicator:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end