其他分享
首页 > 其他分享> > 重拾iOS之Xcode13.2.1新建工程

重拾iOS之Xcode13.2.1新建工程

作者:互联网

1.删除SceneDelegate.h和SceneDelegate.m文件;

2.删除APPDelegate中下面部分内容;

#pragma mark - UISceneSession lifecycle

3.Main.StroyBoard入口去掉;

4.删除info.plist中Application Scene Manifest键值对;

5.设置RootViewcontroller

APPDelegate.h文件中

@property (nonatomic,strong) UIWindow *window;

APPDelegate.m文件中

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    ViewController *vc = [[ViewController alloc] init];
    self.window.rootViewController = vc;
    [self.window makeKeyAndVisible];
   
    return YES;
}

 

标签:vc,ViewController,Xcode13.2,iOS,APPDelegate,application,window,重拾,self
来源: https://www.cnblogs.com/siasyl/p/15984472.html