Skip to content

Instantly share code, notes, and snippets.

@astannard
Created February 2, 2015 08:23
Show Gist options
  • Save astannard/fc42d95ec49e167915dd to your computer and use it in GitHub Desktop.
Save astannard/fc42d95ec49e167915dd to your computer and use it in GitHub Desktop.
iOS swift setup cache
//Withing APP Delegate
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let cache = NSURLCache(memoryCapacity: 8 * 1024 * 1024, diskCapacity: 20 * 1024 * 1024, diskPath: nil)
NSURLCache.setSharedURLCache(cache)
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment