devsite/tools/jazzy/templates

FirebaseFirestore Framework Reference

PersistentCacheSettings

class PersistentCacheSettings : NSObject, NSCopying, LocalCacheSettings

Configures the SDK to use a persistent cache. Firestore documents and mutations are persisted across App restart.

This is the default cache type unless explicitly specified otherwise.

To use, create an instance using one of the initializers, then set the instance to FirestoreSettings.cacheSettings, and use FirestoreSettings instance to configure Firestore SDK.

  • Creates PersistentCacheSettings with default cache size: 100MB.

    The cache size is not a hard limit, but a target for the SDK’s garbage collector to work towards.

    Declaration

    Swift

    init()
  • Creates PersistentCacheSettings with a custom cache size in bytes.

    The cache size is not a hard limit, but a target for the SDK’s garbage collector to work towards.

    Declaration

    Swift

    init(sizeBytes size: NSNumber)