Created
September 3, 2019 06:06
-
-
Save mjhassan/42d2b156fd3a910563c1512849ddc8fa to your computer and use it in GitHub Desktop.
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
| URLCache.shared = { | |
| let cacheDirectory = (NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0] as String).appendingFormat("/\(Bundle.main.bundleIdentifier ?? "cache")/" ) | |
| return URLCache(memoryCapacity: /*your_desired_memory_cache_size*/, | |
| diskCapacity: /*your_desired_disk_cache_size*/, | |
| diskPath: cacheDirectory) | |
| }() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment