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,两个步骤完事!

相关推荐
2601_9657984719 小时前
Build a Fast, High-Ranking Restaurant Website with Rolanda Theme
开发语言·ios·swift
极客互动API20 小时前
企业微信 iPad 协议消息接口开发:文本 / 图片 / 群发消息的统一封装
人工智能·ios·微信·机器人·企业微信·ipad
我血条子呢1 天前
iOS 软键盘遮挡底部输入框解决报告
ios
思盛iOS签名上架1 天前
为什么 iOS 需要签名?未签名 App 无法安装的底层逻辑
ios
Data_Journal2 天前
Golang 中解析 HTML 的指南
ios·iphone
jike_20262 天前
销售拜访记录APP推荐:客户沟通内容怎么快速整理?
ios·语音识别·iphone
00后程序员张2 天前
iOS 开发全流程需要哪些工具?编码、调试、构建、发布阶段选择
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
游戏开发爱好者82 天前
WebSocket 抓包怎么查看内容?从握手到消息帧完整解读
网络协议·计算机网络·网络安全·ios·adb·https·udp
悟空瞎说3 天前
# Alamofire 使用文档 完整翻译
ios