Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 100 lines (80 sloc) 2.496 kb
6f3623e4 »
2011-12-11 initial
1 //
2 // ViewController.m
3 // VisualAid
4 //
5 // Created by David Rodriguez on 12/11/11.
6 // Copyright (c) 2011 UNAM. All rights reserved.
7 //
8
9 #import "ViewController.h"
10
11 @implementation ViewController
12
13 @synthesize productButton;
14
37941bc5 »
2011-12-11 integracion clase
15 -(IBAction) openResources:(UIButton *) sender
6f3623e4 »
2011-12-11 initial
16 {
17
18 ResourceViewController *resource = [[ResourceViewController alloc] initWithNibName:@"ResourceViewController" bundle:nil];
19 resource.modalTransitionStyle=UIModalTransitionStyleCoverVertical;
37941bc5 »
2011-12-11 integracion clase
20
0e131911 »
2011-12-11 integracion de pdf y videos
21 ResourceManager *manager = [[ResourceManager alloc]init];
22
37941bc5 »
2011-12-11 integracion clase
23 UIImageView *logo = (UIImageView *)[resource.view viewWithTag:99];
0e131911 »
2011-12-11 integracion de pdf y videos
24 NSString *imageName = [NSString stringWithFormat:@"logo%@.png", [manager nameOfProduct:sender.tag]];
37941bc5 »
2011-12-11 integracion clase
25 [logo setImage:[UIImage imageNamed:imageName]];
26 resource.logo = logo;
0e131911 »
2011-12-11 integracion de pdf y videos
27 resource.productType=sender.tag;
28
29 NSLog(@"va");
30 if (![manager productHasVisualAids:sender.tag]){
31 UIButton *res = (UIButton *)[resource.view viewWithTag:1];
687c4723 »
2011-12-12 fixes al codigo
32 //res.alpha = 0.5;
33 res.enabled=NO;
0e131911 »
2011-12-11 integracion de pdf y videos
34 }
35 NSLog(@"xx");
36 if (![manager productHasExtras:sender.tag]){
37 UIButton *res = (UIButton *)[resource.view viewWithTag:2];
687c4723 »
2011-12-12 fixes al codigo
38 //res.alpha = 0.5;
39 res.enabled=NO;
0e131911 »
2011-12-11 integracion de pdf y videos
40 }
41 NSLog(@"vid");
42 if (![manager productHasVideos:sender.tag]){
43 UIButton *res = (UIButton *)[resource.view viewWithTag:3];
687c4723 »
2011-12-12 fixes al codigo
44 //res.alpha = 0.5;
45 res.enabled=NO;
0e131911 »
2011-12-11 integracion de pdf y videos
46 }
0c2a2f52 » vidriloco
2011-12-11 Integración video
47
0e131911 »
2011-12-11 integracion de pdf y videos
48
6f3623e4 »
2011-12-11 initial
49 [self presentModalViewController:resource animated:YES];
50 }
51
52 - (void)didReceiveMemoryWarning
53 {
54 [super didReceiveMemoryWarning];
55 // Release any cached data, images, etc that aren't in use.
56 }
57
58 #pragma mark - View lifecycle
59
60 - (void)viewDidLoad
61 {
62 [super viewDidLoad];
63 // Do any additional setup after loading the view, typically from a nib.
64 }
65
66 - (void)viewDidUnload
67 {
68 [super viewDidUnload];
69 // Release any retained subviews of the main view.
70 // e.g. self.myOutlet = nil;
71 [productButton release];
72 }
73
74 - (void)viewWillAppear:(BOOL)animated
75 {
76 [super viewWillAppear:animated];
77 }
78
79 - (void)viewDidAppear:(BOOL)animated
80 {
81 [super viewDidAppear:animated];
82 }
83
84 - (void)viewWillDisappear:(BOOL)animated
85 {
86 [super viewWillDisappear:animated];
87 }
88
89 - (void)viewDidDisappear:(BOOL)animated
90 {
91 [super viewDidDisappear:animated];
92 }
93
94 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
95 {
96 // Return YES for supported orientations
97 return UIInterfaceOrientationIsLandscape(interfaceOrientation);
98 }
99
100 @end
Something went wrong with that request. Please try again.