-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSCLandingPageViewController.m
108 lines (82 loc) · 2.96 KB
/
SCLandingPageViewController.m
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
//
// SCLandingPageViewController.m
// scanorama
//
// Created by Lion User on 06/09/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "SCLandingPageViewController.h"
#import "SCScheduleViewController.h"
#import "SCConfig.h"
#import "SCJsonDatabase.h"
@interface SCLandingPageViewController ()
@end
@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect {
UIColor *color = [UIColor blueColor];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColor(context, CGColorGetComponents( [color CGColor]));
CGContextFillRect(context, rect);
}
@end
@implementation SCLandingPageViewController
@synthesize vilniusButton = _vilniusButton;
@synthesize kaunasButton = _kaunasButton;
@synthesize klaipedaButton = _klaipedaButton;
@synthesize siauliaiButton = _siauliaiButton;
@synthesize cityId = _cityId;
- (void)viewDidLoad
{
SCJsonDatabase *jsonDb = [[SCJsonDatabase alloc] init];
// [jsonDb insertMoviesJsonToDatabase];
// [jsonDb insertScheduleJsonToDatabase];
// [[self navigationController] setTitle:@"Landing Page"];
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)viewDidUnload
{
[self setVilniusButton:nil];
[self setKaunasButton:nil];
[self setKlaipedaButton:nil];
[self setSiauliaiButton:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (IBAction)landingButton:(UIButton *)sender {
SCConfig *config = [SCConfig sharedInstance];
if(sender == _vilniusButton ){
NSLog(@"Vilnius");
[config setCityId:[NSNumber numberWithInt:1]];
}
else if(sender == _kaunasButton) {
NSLog(@"Kaunas");
[config setCityId:[NSNumber numberWithInt:2]];
}
else if(sender == _klaipedaButton) {
NSLog(@"Klaipeda");
[config setCityId:[NSNumber numberWithInt:3]];
}
else if(sender == _siauliaiButton) {
NSLog(@"Siauliai");
[config setCityId:[NSNumber numberWithInt:4]];
}
//[self setView:(UIView*)viewContr];
[self performSegueWithIdentifier:@"showSchedule" sender:self];
}
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if([segue.identifier isEqualToString:@"showSchedule"]){
// SCScheduleViewController *scheduleController = (SCScheduleViewController *)segue.destinationViewController;
// if([scheduleController respondsToSelector:@selector(cityToolbarButton) ])
// NSLog(@"%@",scheduleController.cityToolbarButton);
// [newController setT]
// newController.testInt = [NSNumber numberWithInt:15];
// NSLog(@"%@", newController);
}
// [(SCFirstViewController *)segue.destinationViewController setView:<#(UIView *)#>]
}
@end