From b01dcb775c98cc48abe65a91ef9bf093be875682 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 2 Mar 2026 23:52:25 +0800 Subject: improve template dirs --- .../templates/objc/xcode/iosapp/src/AppDelegate.h | 15 ++++ .../templates/objc/xcode/iosapp/src/AppDelegate.m | 41 +++++++++ .../AppIcon.appiconset/Contents.json | 98 ++++++++++++++++++++++ .../xcode/iosapp/src/Assets.xcassets/Contents.json | 6 ++ .../iosapp/src/Base.lproj/LaunchScreen.storyboard | 25 ++++++ .../xcode/iosapp/src/Base.lproj/Main.storyboard | 24 ++++++ xmake/templates/objc/xcode/iosapp/src/Info.plist | 66 +++++++++++++++ .../objc/xcode/iosapp/src/SceneDelegate.h | 16 ++++ .../objc/xcode/iosapp/src/SceneDelegate.m | 50 +++++++++++ .../objc/xcode/iosapp/src/ViewController.h | 15 ++++ .../objc/xcode/iosapp/src/ViewController.m | 23 +++++ xmake/templates/objc/xcode/iosapp/src/main.m | 19 +++++ 12 files changed, 398 insertions(+) create mode 100644 xmake/templates/objc/xcode/iosapp/src/AppDelegate.h create mode 100644 xmake/templates/objc/xcode/iosapp/src/AppDelegate.m create mode 100644 xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard create mode 100644 xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode/iosapp/src/Info.plist create mode 100644 xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h create mode 100644 xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m create mode 100644 xmake/templates/objc/xcode/iosapp/src/ViewController.h create mode 100644 xmake/templates/objc/xcode/iosapp/src/ViewController.m create mode 100644 xmake/templates/objc/xcode/iosapp/src/main.m (limited to 'xmake/templates/objc/xcode/iosapp/src') diff --git a/xmake/templates/objc/xcode/iosapp/src/AppDelegate.h b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.h new file mode 100644 index 000000000..b01a8dc72 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/xmake/templates/objc/xcode/iosapp/src/AppDelegate.m b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.m new file mode 100644 index 000000000..0ad500bfe --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.m @@ -0,0 +1,41 @@ +// +// AppDelegate.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d8db8d65f --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode/iosapp/src/Info.plist b/xmake/templates/objc/xcode/iosapp/src/Info.plist new file mode 100644 index 000000000..686d21a3a --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h new file mode 100644 index 000000000..5dbf88aa6 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h @@ -0,0 +1,16 @@ +// +// SceneDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m new file mode 100644 index 000000000..d6698dd7c --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m @@ -0,0 +1,50 @@ +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/xmake/templates/objc/xcode/iosapp/src/ViewController.h b/xmake/templates/objc/xcode/iosapp/src/ViewController.h new file mode 100644 index 000000000..e74d2f236 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/xmake/templates/objc/xcode/iosapp/src/ViewController.m b/xmake/templates/objc/xcode/iosapp/src/ViewController.m new file mode 100644 index 000000000..c3441c87a --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/ViewController.m @@ -0,0 +1,23 @@ +// +// ViewController.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + + +@end diff --git a/xmake/templates/objc/xcode/iosapp/src/main.m b/xmake/templates/objc/xcode/iosapp/src/main.m new file mode 100644 index 000000000..11a58afc7 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/main.m @@ -0,0 +1,19 @@ +// +// main.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} -- cgit v1.3.1