1,xcode版本10.1,首先在LaunchScreen.storyboard上設(shè)置一下StoryBoard ID 如圖

2,在APPDelegate.m中增加屬性:@property (strong, nonatomic) UIView *launchView;
3,在- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions;中調(diào)用下面方法
-(void)setLaunchImg{
? ? UIViewController *viewController = [[UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil] instantiateViewControllerWithIdentifier:@"LaunchScreen"];
? ? self.launchView= viewController.view;
? ? self.launchView.frame = CGRectMake(0, 0, self.window.screen.bounds.size.width, self.window.screen.bounds.size.height);
? ? [self.window addSubview:self.launchView];
? ? UIImageView*imageV = [[UIImageViewalloc]initWithFrame:CGRectMake(0,0,self.launchView.frame.size.width,self.launchView.frame.size.height)];
? ? [imageVsetImage:[UIImageimageNamed:@"logo.jpeg"]];
? ? imageV.contentMode = UIViewContentModeScaleAspectFill;
? ? [self.launchViewaddSubview:imageV];
? ? [self.window bringSubviewToFront:self.launchView];
//可以設(shè)置啟動(dòng)頁的存在時(shí)間
? ? [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(removeLun) userInfo:nil repeats:NO];
}
-(void)removeLun
{
?? ?[self.launchView removeFromSuperview];
}