Skip to content

Instantly share code, notes, and snippets.

@thexande
Created December 20, 2018 05:03
Show Gist options
  • Save thexande/58cffbe53fba642f8202d8aaa62b3b8e to your computer and use it in GitHub Desktop.
Save thexande/58cffbe53fba642f8202d8aaa62b3b8e to your computer and use it in GitHub Desktop.
/// A cache policy that specifies whether results should be fetched from the server or loaded from the local cache.
public enum CachePolicy {
/// Return data from the cache if available, else fetch results from the server.
case returnCacheDataElseFetch
/// Always fetch results from the server.
case fetchIgnoringCacheData
/// Return data from the cache if available, else return nil.
case returnCacheDataDontFetch
/// Return data from the cache if available, and always fetch results from the server.
case returnCacheDataAndFetch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment