This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git


The following commit(s) were added to refs/heads/master by this push:
     new 77b46896 fix: Various ObjC/template cleanups (#1354)
77b46896 is described below

commit 77b46896a43c6c3d5f9ce8ae85bfa84084993cce
Author: Darryl Pogue <[email protected]>
AuthorDate: Tue Jul 4 17:26:51 2023 -0700

    fix: Various ObjC/template cleanups (#1354)
    
    * fix: Some minor Objective C cleanups
    * fix: Minor Xcode project file restructuring
    * fix: ability to add to resources group (#3)
    
    ---------
    
    Co-authored-by: エリス <[email protected]>
---
 CordovaLib/Classes/Public/CDVAppDelegate.m         | 23 +++----
 CordovaLib/Classes/Public/CDVViewController.m      | 34 ---------
 CordovaLib/include/Cordova/CDVAppDelegate.h        |  8 +--
 lib/create.js                                      |  8 +--
 .../__PROJECT_NAME__.xcodeproj/project.pbxproj     | 44 +++++-------
 .../__PROJECT_NAME__/{Classes => }/AppDelegate.h   | 11 +--
 .../__PROJECT_NAME__/{Classes => }/AppDelegate.m   | 10 +--
 .../__PROJECT_NAME__/Classes/MainViewController.m  | 80 ----------------------
 .../{Classes => }/MainViewController.h             |  8 ---
 .../MainViewController.h => MainViewController.m}  | 16 ++---
 .../{Classes => }/MainViewController.xib           |  0
 templates/project/__PROJECT_NAME__/main.m          | 17 ++---
 12 files changed, 48 insertions(+), 211 deletions(-)

diff --git a/CordovaLib/Classes/Public/CDVAppDelegate.m 
b/CordovaLib/Classes/Public/CDVAppDelegate.m
index 8792e200..a77fd2b4 100644
--- a/CordovaLib/Classes/Public/CDVAppDelegate.m
+++ b/CordovaLib/Classes/Public/CDVAppDelegate.m
@@ -23,18 +23,19 @@
 
 @synthesize window, viewController;
 
-- (id)init
+- (BOOL)application:(UIApplication *)application 
willFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> 
*)launchOptions
 {
-    self = [super init];
-    return self;
-}
+#if DEBUG
+    NSLog(@"Apache Cordova iOS platform version %@ is starting.", CDV_VERSION);
+#endif
 
-#pragma mark UIApplicationDelegate implementation
+    return YES;
+}
 
 /**
  * This is main kick off after the app inits, the views and Settings are setup 
here. (preferred - iOS4 and up)
  */
-- (BOOL)application:(UIApplication*)application 
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
+- (BOOL)application:(UIApplication *)application 
didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> 
*)launchOptions
 {
     CGRect screenBounds = [[UIScreen mainScreen] bounds];
 
@@ -60,7 +61,7 @@
 }
 
 // this happens while we are running ( in the background, or from within our 
own app )
-// only valid if 40x-Info.plist specifies a protocol to handle
+// only valid if Info.plist specifies a protocol to handle
 - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url 
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
 {
     if (!url) {
@@ -86,12 +87,4 @@
     return YES;
 }
 
-- (UIInterfaceOrientationMask)application:(UIApplication*)application 
supportedInterfaceOrientationsForWindow:(UIWindow*)window
-{
-    // iPhone doesn't support upside down by default, while the iPad does.  
Override to allow all orientations always, and let the root view controller 
decide what's allowed (the supported orientations mask gets intersected).
-    NSUInteger supportedInterfaceOrientations = (1 << 
UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | 
(1 << UIInterfaceOrientationLandscapeRight) | (1 << 
UIInterfaceOrientationPortraitUpsideDown);
-
-    return supportedInterfaceOrientations;
-}
-
 @end
diff --git a/CordovaLib/Classes/Public/CDVViewController.m 
b/CordovaLib/Classes/Public/CDVViewController.m
index 9302dc2b..dd8ba165 100644
--- a/CordovaLib/Classes/Public/CDVViewController.m
+++ b/CordovaLib/Classes/Public/CDVViewController.m
@@ -80,9 +80,6 @@
         self.supportedOrientations = [self parseInterfaceOrientations:
             [[[NSBundle mainBundle] infoDictionary] 
objectForKey:@"UISupportedInterfaceOrientations"]];
 
-        [self printVersion];
-        [self printMultitaskingInfo];
-        [self printPlatformVersionWarning];
         self.initialized = YES;
     }
 }
@@ -108,37 +105,6 @@
     return self;
 }
 
-- (void)printVersion
-{
-    NSLog(@"Apache Cordova native platform version %@ is starting.", 
CDV_VERSION);
-}
-
-- (void)printPlatformVersionWarning
-{
-    if (!IsAtLeastiOSVersion(@"8.0")) {
-        NSLog(@"CRITICAL: For Cordova 4.0.0 and above, you will need to 
upgrade to at least iOS 8.0 or greater. Your current version of iOS is %@.",
-            [[UIDevice currentDevice] systemVersion]
-            );
-    }
-}
-
-- (void)printMultitaskingInfo
-{
-    UIDevice* device = [UIDevice currentDevice];
-    BOOL backgroundSupported = NO;
-
-    if ([device respondsToSelector:@selector(isMultitaskingSupported)]) {
-        backgroundSupported = device.multitaskingSupported;
-    }
-
-    NSNumber* exitsOnSuspend = [[NSBundle mainBundle] 
objectForInfoDictionaryKey:@"UIApplicationExitsOnSuspend"];
-    if (exitsOnSuspend == nil) { // if it's missing, it should be NO (i.e. 
multi-tasking on by default)
-        exitsOnSuspend = [NSNumber numberWithBool:NO];
-    }
-
-    NSLog(@"Multi-tasking -> Device: %@, App: %@", (backgroundSupported ? 
@"YES" : @"NO"), (![exitsOnSuspend intValue]) ? @"YES" : @"NO");
-}
-
 -(NSString*)configFilePath{
     NSString* path = self.configFile ?: @"config.xml";
 
diff --git a/CordovaLib/include/Cordova/CDVAppDelegate.h 
b/CordovaLib/include/Cordova/CDVAppDelegate.h
index cce9c342..e2cd85d8 100644
--- a/CordovaLib/include/Cordova/CDVAppDelegate.h
+++ b/CordovaLib/include/Cordova/CDVAppDelegate.h
@@ -17,12 +17,12 @@
  under the License.
  */
 
-#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
 #import <Cordova/CDVViewController.h>
 
-@interface CDVAppDelegate : NSObject <UIApplicationDelegate>{}
+@interface CDVAppDelegate : UIResponder <UIApplicationDelegate>
 
-@property (nonatomic, strong) IBOutlet UIWindow* window;
-@property (nonatomic, strong) IBOutlet CDVViewController* viewController;
+@property (nullable, nonatomic, strong) IBOutlet UIWindow* window;
+@property (nullable, nonatomic, strong) IBOutlet CDVViewController* 
viewController;
 
 @end
diff --git a/lib/create.js b/lib/create.js
index 9aefb6ac..7a15ee84 100755
--- a/lib/create.js
+++ b/lib/create.js
@@ -175,10 +175,10 @@ class ProjectCreator {
             '__PROJECT_NAME__.xcworkspace/contents.xcworkspacedata',
             
'__PROJECT_NAME__.xcworkspace/xcshareddata/xcschemes/__PROJECT_NAME__.xcscheme',
             '__PROJECT_NAME__.xcodeproj/project.pbxproj',
-            '__PROJECT_NAME__/Classes/AppDelegate.h',
-            '__PROJECT_NAME__/Classes/AppDelegate.m',
-            '__PROJECT_NAME__/Classes/MainViewController.h',
-            '__PROJECT_NAME__/Classes/MainViewController.m',
+            '__PROJECT_NAME__/AppDelegate.h',
+            '__PROJECT_NAME__/AppDelegate.m',
+            '__PROJECT_NAME__/MainViewController.h',
+            '__PROJECT_NAME__/MainViewController.m',
             '__PROJECT_NAME__/main.m',
             '__PROJECT_NAME__/__PROJECT_NAME__-Info.plist',
             '__PROJECT_NAME__/__PROJECT_NAME__-Prefix.pch'
diff --git a/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj 
b/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj
index d01241ee..068e81f8 100755
--- a/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj
+++ b/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj
@@ -58,7 +58,7 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
-               0207DA571B56EA530066E2B4 /* Assets.xcassets */ = {isa = 
PBXFileReference; lastKnownFileType = folder.assetcatalog; name = 
Assets.xcassets; path = "__PROJECT_NAME__/Assets.xcassets"; sourceTree = 
SOURCE_ROOT; };
+               0207DA571B56EA530066E2B4 /* Assets.xcassets */ = {isa = 
PBXFileReference; lastKnownFileType = folder.assetcatalog; name = 
Assets.xcassets; sourceTree = "<group>"; };
                1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
AppDelegate.h; sourceTree = "<group>"; };
                1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= AppDelegate.m; sourceTree = "<group>"; };
                1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */ = {isa = 
PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; 
path = "__PROJECT_NAME__.app"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -72,8 +72,8 @@
                3047A5101AB8059700498E2A /* build-release.xcconfig */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = 
"build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = 
SOURCE_ROOT; };
                3047A5111AB8059700498E2A /* build.xcconfig */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = 
build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; };
                32CA4F630368D1EE00C91783 /* __PROJECT_NAME__-Prefix.pch */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = "__PROJECT_NAME__-Prefix.pch"; sourceTree = "<group>"; };
-               6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; 
name = CDVLaunchScreen.storyboard; path = 
"__PROJECT_NAME__/CDVLaunchScreen.storyboard"; sourceTree = SOURCE_ROOT; };
-               8D1107310486CEB800E47090 /* __PROJECT_NAME__-Info.plist */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; 
name = "__PROJECT_NAME__-Info.plist"; path = 
"__PROJECT_NAME__/__PROJECT_NAME__-Info.plist"; 
plistStructureDefinitionIdentifier = 
"com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = 
SOURCE_ROOT; };
+               6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; 
name = CDVLaunchScreen.storyboard; sourceTree = "<group>"; };
+               8D1107310486CEB800E47090 /* __PROJECT_NAME__-Info.plist */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; 
name = "__PROJECT_NAME__-Info.plist"; plistStructureDefinitionIdentifier = 
"com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = 
"<group>"; };
                EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; 
lastKnownFileType = folder; name = www; path = ../../www; sourceTree = 
"<group>"; };
                EB87FDF41871DAF40020F90C /* config.xml */ = {isa = 
PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = 
../../config.xml; sourceTree = "<group>"; };
                ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
"Bridging-Header.h"; sourceTree = "<group>"; };
@@ -92,19 +92,6 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
-               080E96DDFE201D6D7F000001 /* Classes */ = {
-                       isa = PBXGroup;
-                       children = (
-                               302D95EE14D2391D003F00A1 /* 
MainViewController.h */,
-                               302D95EF14D2391D003F00A1 /* 
MainViewController.m */,
-                               302D95F014D2391D003F00A1 /* 
MainViewController.xib */,
-                               1D3623240D0F684500981E51 /* AppDelegate.h */,
-                               1D3623250D0F684500981E51 /* AppDelegate.m */,
-                       );
-                       name = Classes;
-                       path = "__PROJECT_NAME__/Classes";
-                       sourceTree = SOURCE_ROOT;
-               };
                19C28FACFE9D520D11CA2CBB /* Products */ = {
                        isa = PBXGroup;
                        children = (
@@ -117,12 +104,12 @@
                        isa = PBXGroup;
                        children = (
                                EB87FDF41871DAF40020F90C /* config.xml */,
+                               3047A50E1AB8057F00498E2A /* config */,
                                EB87FDF31871DA8E0020F90C /* www */,
                                EB87FDF11871DA420020F90C /* Staging */,
                                301BF52D109A57CC0062928A /* 
CordovaLib/CordovaLib.xcodeproj */,
-                               080E96DDFE201D6D7F000001 /* Classes */,
+                               29B97315FDCFA39411CA2CEA /* __PROJECT_NAME__ */,
                                307C750510C5A3420062BCA9 /* Plugins */,
-                               29B97315FDCFA39411CA2CEA /* Other Sources */,
                                29B97317FDCFA39411CA2CEA /* Resources */,
                                29B97323FDCFA39411CA2CEA /* Frameworks */,
                                19C28FACFE9D520D11CA2CBB /* Products */,
@@ -130,25 +117,28 @@
                        name = CustomTemplate;
                        sourceTree = "<group>";
                };
-               29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+               29B97315FDCFA39411CA2CEA /* __PROJECT_NAME__ */ = {
                        isa = PBXGroup;
                        children = (
+                               8D1107310486CEB800E47090 /* 
__PROJECT_NAME__-Info.plist */,
                                32CA4F630368D1EE00C91783 /* 
__PROJECT_NAME__-Prefix.pch */,
-                               29B97316FDCFA39411CA2CEA /* main.m */,
+                               6AFF5BF81D6E424B00AB3073 /* 
CDVLaunchScreen.storyboard */,
+                               0207DA571B56EA530066E2B4 /* Assets.xcassets */,
                                ED33DF2A687741AEAF9F8254 /* Bridging-Header.h 
*/,
+                               302D95EE14D2391D003F00A1 /* 
MainViewController.h */,
+                               302D95EF14D2391D003F00A1 /* 
MainViewController.m */,
+                               302D95F014D2391D003F00A1 /* 
MainViewController.xib */,
+                               1D3623240D0F684500981E51 /* AppDelegate.h */,
+                               1D3623250D0F684500981E51 /* AppDelegate.m */,
+                               29B97316FDCFA39411CA2CEA /* main.m */,
                        );
-                       name = "Other Sources";
+                       name = "__PROJECT_NAME__";
                        path = "__PROJECT_NAME__";
                        sourceTree = "<group>";
                };
                29B97317FDCFA39411CA2CEA /* Resources */ = {
                        isa = PBXGroup;
-                       children = (
-                               0207DA571B56EA530066E2B4 /* Assets.xcassets */,
-                               3047A50E1AB8057F00498E2A /* config */,
-                               8D1107310486CEB800E47090 /* 
__PROJECT_NAME__-Info.plist */,
-                               6AFF5BF81D6E424B00AB3073 /* 
CDVLaunchScreen.storyboard */,
-                       );
+                       children = ();
                        name = Resources;
                        path = "__PROJECT_NAME__/Resources";
                        sourceTree = "<group>";
diff --git a/templates/project/__PROJECT_NAME__/Classes/AppDelegate.h 
b/templates/project/__PROJECT_NAME__/AppDelegate.h
similarity index 76%
rename from templates/project/__PROJECT_NAME__/Classes/AppDelegate.h
rename to templates/project/__PROJECT_NAME__/AppDelegate.h
index 2f72442a..8c27551c 100644
--- a/templates/project/__PROJECT_NAME__/Classes/AppDelegate.h
+++ b/templates/project/__PROJECT_NAME__/AppDelegate.h
@@ -17,17 +17,8 @@
  under the License.
  */
 
-//
-//  AppDelegate.h
-//  __PROJECT_NAME__
-//
-//  Created by ___FULLUSERNAME___ on ___DATE___.
-//  Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
-
-#import <Cordova/CDVViewController.h>
 #import <Cordova/CDVAppDelegate.h>
 
-@interface AppDelegate : CDVAppDelegate {}
+@interface AppDelegate : CDVAppDelegate
 
 @end
diff --git a/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m 
b/templates/project/__PROJECT_NAME__/AppDelegate.m
similarity index 78%
rename from templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
rename to templates/project/__PROJECT_NAME__/AppDelegate.m
index f936ce3b..3d2b6ffd 100644
--- a/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
+++ b/templates/project/__PROJECT_NAME__/AppDelegate.m
@@ -17,20 +17,12 @@
  under the License.
  */
 
-//
-//  AppDelegate.m
-//  __PROJECT_NAME__
-//
-//  Created by ___FULLUSERNAME___ on ___DATE___.
-//  Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
-
 #import "AppDelegate.h"
 #import "MainViewController.h"
 
 @implementation AppDelegate
 
-- (BOOL)application:(UIApplication*)application 
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
+- (BOOL)application:(UIApplication *)application 
didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> 
*)launchOptions
 {
     self.viewController = [[MainViewController alloc] init];
     return [super application:application 
didFinishLaunchingWithOptions:launchOptions];
diff --git a/templates/project/__PROJECT_NAME__/Classes/MainViewController.m 
b/templates/project/__PROJECT_NAME__/Classes/MainViewController.m
deleted file mode 100644
index dcb15d97..00000000
--- a/templates/project/__PROJECT_NAME__/Classes/MainViewController.m
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-//
-//  MainViewController.h
-//  __PROJECT_NAME__
-//
-//  Created by ___FULLUSERNAME___ on ___DATE___.
-//  Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
-
-#import "MainViewController.h"
-
-@implementation MainViewController
-
-- (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
-{
-    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
-    if (self) {
-        // Uncomment to override the CDVCommandDelegate used
-        // _commandDelegate = [[MainCommandDelegate alloc] 
initWithViewController:self];
-        // Uncomment to override the CDVCommandQueue used
-        // _commandQueue = [[MainCommandQueue alloc] 
initWithViewController:self];
-    }
-    return self;
-}
-
-- (id)init
-{
-    self = [super init];
-    if (self) {
-        // Uncomment to override the CDVCommandDelegate used
-        // _commandDelegate = [[MainCommandDelegate alloc] 
initWithViewController:self];
-        // Uncomment to override the CDVCommandQueue used
-        // _commandQueue = [[MainCommandQueue alloc] 
initWithViewController:self];
-    }
-    return self;
-}
-
-- (void)didReceiveMemoryWarning
-{
-    // Releases the view if it doesn't have a superview.
-    [super didReceiveMemoryWarning];
-
-    // Release any cached data, images, etc that aren't in use.
-}
-
-#pragma mark View lifecycle
-
-- (void)viewWillAppear:(BOOL)animated
-{
-    // View defaults to full size.  If you want to customize the view's size, 
or its subviews (e.g. webView),
-    // you can do so here.
-
-    [super viewWillAppear:animated];
-}
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    [self.launchView setAlpha:1];
-}
-
-@end
diff --git a/templates/project/__PROJECT_NAME__/Classes/MainViewController.h 
b/templates/project/__PROJECT_NAME__/MainViewController.h
similarity index 83%
copy from templates/project/__PROJECT_NAME__/Classes/MainViewController.h
copy to templates/project/__PROJECT_NAME__/MainViewController.h
index 009b0540..1bbe01c2 100644
--- a/templates/project/__PROJECT_NAME__/Classes/MainViewController.h
+++ b/templates/project/__PROJECT_NAME__/MainViewController.h
@@ -17,14 +17,6 @@
  under the License.
  */
 
-//
-//  MainViewController.h
-//  __PROJECT_NAME__
-//
-//  Created by ___FULLUSERNAME___ on ___DATE___.
-//  Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
-
 #import <Cordova/CDVViewController.h>
 
 @interface MainViewController : CDVViewController
diff --git a/templates/project/__PROJECT_NAME__/Classes/MainViewController.h 
b/templates/project/__PROJECT_NAME__/MainViewController.m
similarity index 74%
rename from templates/project/__PROJECT_NAME__/Classes/MainViewController.h
rename to templates/project/__PROJECT_NAME__/MainViewController.m
index 009b0540..b99433a0 100644
--- a/templates/project/__PROJECT_NAME__/Classes/MainViewController.h
+++ b/templates/project/__PROJECT_NAME__/MainViewController.m
@@ -17,16 +17,14 @@
  under the License.
  */
 
-//
-//  MainViewController.h
-//  __PROJECT_NAME__
-//
-//  Created by ___FULLUSERNAME___ on ___DATE___.
-//  Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
+#import "MainViewController.h"
 
-#import <Cordova/CDVViewController.h>
+@implementation MainViewController
 
-@interface MainViewController : CDVViewController
+- (void)viewDidLoad
+{
+    [super viewDidLoad];
+    [self.launchView setAlpha:1];
+}
 
 @end
diff --git a/templates/project/__PROJECT_NAME__/Classes/MainViewController.xib 
b/templates/project/__PROJECT_NAME__/MainViewController.xib
similarity index 100%
rename from templates/project/__PROJECT_NAME__/Classes/MainViewController.xib
rename to templates/project/__PROJECT_NAME__/MainViewController.xib
diff --git a/templates/project/__PROJECT_NAME__/main.m 
b/templates/project/__PROJECT_NAME__/main.m
index 62e5784e..a6bff5b6 100644
--- a/templates/project/__PROJECT_NAME__/main.m
+++ b/templates/project/__PROJECT_NAME__/main.m
@@ -16,20 +16,15 @@
  specific language governing permissions and limitations
  under the License.
  */
-//
-//  main.m
-//  __PROJECT_NAME__
-//
-//  Created by ___FULLUSERNAME___ on ___DATE___.
-//  Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
 
 #import <UIKit/UIKit.h>
+#import "AppDelegate.h"
 
-int main(int argc, char* argv[])
-{
+int main(int argc, char *argv[]) {
+    NSString *appDelegateClassName;
     @autoreleasepool {
-        int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
-        return retVal;
+        // Setup code that might create autoreleased objects goes here.
+        appDelegateClassName = NSStringFromClass([AppDelegate class]);
     }
+    return UIApplicationMain(argc, argv, nil, appDelegateClassName);
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to