Created
February 2, 2015 08:24
-
-
Save astannard/894c2100f6ed33ab628e to your computer and use it in GitHub Desktop.
iOS swift clear cache on memory warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func applicationDidReceiveMemoryWarning(application: UIApplication) { | |
NSURLCache.sharedURLCache().removeAllCachedResponses() | |
} |
swift 4 version is :
URLCache.shared.removeAllCachedResponses()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing this