Xode11
SceneDelegate.m
#import "SceneDelegate.h" #import "ViewController.h" @interface SceneDelegate () @end @implementation SceneDelegate - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { if (@available(ios 13, *)) { if (scene) { self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene]; self.window.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height); self.window.backgroundColor=[UIColor redColor]; UIView* view=[[UIView alloc] initWithFrame:CGRectMake(100, 100, 150, 150)]; view.backgroundColor=[UIColor orangeColor]; [self.window addSubview:view]; UIView* backview =[[UIView alloc] initWithFrame:CGRectMake(0, 0, 240, 360)]; backview.backgroundColor=[UIColor blueColor]; [backview addSubview:view]; [self.window addSubview:backview]; [self.window makeKeyAndVisible]; } } }