IOS不使用默认的mainStroryboard作为首个controller的方法

步骤1:

删除info.plist文件下的一条配置,如图

步骤2:

编辑AppDelegate.m,参考以下代码

复制代码
@interface AppDelegate ()
//@property (strong, nonatomic) UIWindow * window;
@property(nonatomic,strong) UIWindow * win;
@property(nonatomic,strong) MyViewController * mainVC;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
	// 创建自己的window
    self.win = [[UIWindow alloc]initWithFrame:UIScreen.mainScreen.bounds];
    // 创建主controller
    self.mainVC = [MyViewController new];
    // 创建导航,可选
    UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:_mainVC];
    self.win.rootViewController = nav;
    [self.win makeKeyAndVisible];
    return YES;
}

OK,两个步骤完事!

相关推荐
权咚1 天前
阿权的开发经验小集
git·ios·xcode
用户091 天前
TipKit与CloudKit同步完全指南
ios·swift
法的空间2 天前
Flutter JsonToDart 支持 JsonSchema
android·flutter·ios
2501_915918412 天前
iOS 上架全流程指南 iOS 应用发布步骤、App Store 上架流程、uni-app 打包上传 ipa 与审核实战经验分享
android·ios·小程序·uni-app·cocoa·iphone·webview
00后程序员张2 天前
iOS App 混淆与加固对比 源码混淆与ipa文件混淆的区别、iOS代码保护与应用安全场景最佳实践
android·安全·ios·小程序·uni-app·iphone·webview
Magnetic_h2 天前
【iOS】设计模式复习
笔记·学习·ios·设计模式·objective-c·cocoa
00后程序员张2 天前
详细解析苹果iOS应用上架到App Store的完整步骤与指南
android·ios·小程序·https·uni-app·iphone·webview
前端小超超2 天前
capacitor配置ios应用图标不同尺寸
ios·蓝桥杯·cocoa
2501_915106322 天前
Xcode 上传 ipa 全流程详解 App Store 上架流程、uni-app 生成 ipa 文件上传与审核指南
android·macos·ios·小程序·uni-app·iphone·xcode
kymjs张涛2 天前
零一开源|前沿技术周刊 #16
ios·apple·hacker news