Skip to content

Latest commit

 

History

3 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

仓库 files navigation

Clean iOS app launch screen cache

You might have noticed when you tried to change something in the launch screen on the iOS application, you still see the old launch screen. Because the system caches launch images and it's not cleared even after deleting the application.

For cleaning the launch screen, all you have to do to completely clear your app’s launch screen cache is run this code inside your app:

import UIKit

public extension UIApplication {
    func clearLaunchScreenCache() {
        #if DEBUG
        do {
            let launchScreenPath = "\(NSHomeDirectory())/Library/SplashBoard"
            try FileManager.default.removeItem(atPath: launchScreenPath)
        } catch {
            print("Failed to delete launch screen cache - \(error)")
        }
        #endif
    }
}

To use this, add the following lines in the app's didFinishLaunchingWithOptions delegate method:

UIApplication.shared.clearLaunchScreenCache()

关于

No description or website provided.

Topics

Resources

安全 policy

Stars

10 stars

关注者

1 watching

复刻s

发布

Sponsor this project

贡献者

Languages