iOS 使用storyboard 更换启动页无效问题

1、加上清除启动页缓存的代码(最好是接口控制什么时候清除)
2、更换启动页时,把storyboard文件删除,重新建一个,然后把图片文件放到目录下(原图片文件删除,不要放到Assets.xcassets里)

#pragma mark - 清除启动缓存
- (void)clearLaunchData {
    NSString *appVersion = AppVersion();
    NSString *version = [RWCacheTool userInfoCachedValueForKey:@"AppVersionForLaunch"];
    
    //未存过版本/当前版本高于存储版本则清除
    if (version && [appVersion compare:version options:NSNumericSearch] != NSOrderedDescending) {
        return;
    }
    
    [RWCacheTool userInfoCacheValue:appVersion forKey:@"AppVersionForLaunch"];
    NSError *error;
    [NSFileManager.defaultManager removeItemAtPath:[NSString stringWithFormat:@"%@/Library/SplashBoard",NSHomeDirectory()] error:&error];
    if (error) {
        NSLog(@"Failed to delete launch screen cache: %@",error);
    }
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [self clearLaunchData];
}

你可能感兴趣的:(日常笔记,ios,objective-c,开发语言)