Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

MainViewController.m 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. Licensed to the Apache Software Foundation (ASF) under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. The ASF licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. "License"); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing,
  11. software distributed under the License is distributed on an
  12. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13. KIND, either express or implied. See the License for the
  14. specific language governing permissions and limitations
  15. under the License.
  16. */
  17. //
  18. // MainViewController.h
  19. // HelloCordova
  20. //
  21. // Created by ___FULLUSERNAME___ on ___DATE___.
  22. // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
  23. //
  24. #import "MainViewController.h"
  25. @implementation MainViewController
  26. - (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
  27. {
  28. self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
  29. if (self) {
  30. // Uncomment to override the CDVCommandDelegateImpl used
  31. // _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self];
  32. // Uncomment to override the CDVCommandQueue used
  33. // _commandQueue = [[MainCommandQueue alloc] initWithViewController:self];
  34. }
  35. return self;
  36. }
  37. - (id)init
  38. {
  39. self = [super init];
  40. if (self) {
  41. // Uncomment to override the CDVCommandDelegateImpl used
  42. // _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self];
  43. // Uncomment to override the CDVCommandQueue used
  44. // _commandQueue = [[MainCommandQueue alloc] initWithViewController:self];
  45. }
  46. return self;
  47. }
  48. - (void)didReceiveMemoryWarning
  49. {
  50. // Releases the view if it doesn't have a superview.
  51. [super didReceiveMemoryWarning];
  52. // Release any cached data, images, etc that aren't in use.
  53. }
  54. #pragma mark View lifecycle
  55. - (void)viewWillAppear:(BOOL)animated
  56. {
  57. // View defaults to full size. If you want to customize the view's size, or its subviews (e.g. webView),
  58. // you can do so here.
  59. [super viewWillAppear:animated];
  60. }
  61. - (void)viewDidLoad
  62. {
  63. [super viewDidLoad];
  64. // Do any additional setup after loading the view from its nib.
  65. }
  66. - (void)viewDidUnload
  67. {
  68. [super viewDidUnload];
  69. // Release any retained subviews of the main view.
  70. // e.g. self.myOutlet = nil;
  71. }
  72. /* Comment out the block below to over-ride */
  73. /*
  74. - (UIWebView*) newCordovaViewWithFrame:(CGRect)bounds
  75. {
  76. return[super newCordovaViewWithFrame:bounds];
  77. }
  78. // CB-12098
  79. #if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
  80. - (NSUInteger)supportedInterfaceOrientations
  81. #else
  82. - (UIInterfaceOrientationMask)supportedInterfaceOrientations
  83. #endif
  84. {
  85. return [super supportedInterfaceOrientations];
  86. }
  87. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  88. {
  89. return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
  90. }
  91. - (BOOL)shouldAutorotate
  92. {
  93. return [super shouldAutorotate];
  94. }
  95. */
  96. @end
  97. @implementation MainCommandDelegate
  98. /* To override the methods, uncomment the line in the init function(s)
  99. in MainViewController.m
  100. */
  101. #pragma mark CDVCommandDelegate implementation
  102. - (id)getCommandInstance:(NSString*)className
  103. {
  104. return [super getCommandInstance:className];
  105. }
  106. - (NSString*)pathForResource:(NSString*)resourcepath
  107. {
  108. return [super pathForResource:resourcepath];
  109. }
  110. @end
  111. @implementation MainCommandQueue
  112. /* To override, uncomment the line in the init function(s)
  113. in MainViewController.m
  114. */
  115. - (BOOL)execute:(CDVInvokedUrlCommand*)command
  116. {
  117. return [super execute:command];
  118. }
  119. @end