简体   繁体   English

使用 iOS 13.3 在 iphone 11、11 pro、11 pro max 上升级应用程序后显示 iOS (swift) 旧启动屏幕

[英]iOS (swift) old launch screen displaying after upgrade the application on iphone 11 , 11 pro , 11 pro max with iOS 13.3

Steps for replicate :复制步骤:

  1. Create demo project in Xcode 11.3.在 Xcode 11.3 中创建演示项目。
  2. Add some text on launch screen.在启动屏幕上添加一些文本。
  3. Run Project on iphone (real device) 11, 11 pro , 11 pro max with iOS version 13.3.在 iOS 版本 13.3 的 iphone(真实设备)11、11 pro、11 pro max 上运行 Project。
  4. When project is compiled and application launched stop the debugging process.编译项目并启动应用程序时,停止调试过程。
  5. Now change text on Launch screen and debbugg project again.现在更改启动屏幕上的文本并再次调试项目。

Result : Launch screen text not changed.结果:启动屏幕文本未更改。 Old text showing on Launch screen .启动屏幕上显示的旧文本。

The system caches launch images and doesn't clear them very proactively.系统缓存启动图像并且不会非常主动地清除它们。 You can add code to clear the cache yourself, although I'd stick this behind a feature flag as circumventing the cache isn't something you probably want to do all the time.您可以添加代码来自己清除缓存,尽管我会将其放在功能标志后面,因为您可能不会一直想要绕过缓存。

import UIKit

public extension UIApplication {

    func clearLaunchScreenCache() {
        do {
            try FileManager.default.removeItem(atPath: NSHomeDirectory()+"/Library/SplashBoard")
        } catch {
            print("Failed to delete launch screen cache: \(error)")
        }
    }

}

Code snippet taken from: https://rambo.codes/posts/2019-12-09-clearing-your-apps-launch-screen-cache-on-ios代码片段取自: https ://rambo.codes/posts/2019-12-09-clearing-your-apps-launch-screen-cache-on-ios

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM