Skip to content

Instantly share code, notes, and snippets.

@mjhassan
Created September 3, 2019 04:48
Show Gist options
  • Select an option

  • Save mjhassan/ea14ab990cdfb2fd2ebd006ed1fe6a80 to your computer and use it in GitHub Desktop.

Select an option

Save mjhassan/ea14ab990cdfb2fd2ebd006ed1fe6a80 to your computer and use it in GitHub Desktop.
way to config shared URLCache from AppDelegate
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let diskCacheSize = 500*1024*1024 // 500MB
URLCache.configSharedCache(disk: diskCacheSize)
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment