Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

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()

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages