SBSDKStorageLocation

@interface SBSDKStorageLocation : NSObject

Descriptor and helper class for describing and creating a directory on the file system.

  • The URL of the applications documents folder.

    Declaration

    Objective-C

    + (nonnull NSURL *)applicationDocumentsFolderURL;

    Swift

    class func applicationDocumentsFolderURL() -> URL
  • The URL of the applications support folder.

    Declaration

    Objective-C

    + (nonnull NSURL *)applicationSupportFolderURL;

    Swift

    class func applicationSupportFolderURL() -> URL
  • The URL of the applications caches folder.

    Declaration

    Objective-C

    + (nonnull NSURL *)applicationCachesFolderURL;

    Swift

    class func applicationCachesFolderURL() -> URL
  • Designated initializer.

    Declaration

    Objective-C

    - (nullable instancetype)initWithBaseURL:(nullable NSURL *)baseURL;

    Swift

    init?(baseURL: URL?)

    Parameters

    baseURL

    The URL of the folder in which the new storage should be located. If the folder does not exist, it is created. If nil the new location will reside in the ‘defaultURL’.

    Return Value

    The new storage location living at the given folder.

  • Generates a file or folder URL with the given name in the folder of the receivers baseURL.

    Declaration

    Objective-C

    - (nullable NSURL *)URLWithKey:(nonnull NSString *)key;

    Swift

    func url(withKey key: String) -> URL?

    Parameters

    key

    The name of the file or folder within the receivers.

    Return Value

    A file or folder URL with the given name in the folder of the receivers baseURL

  • The default base URL for new storage locations. *

    Declaration

    Objective-C

    + (nonnull NSURL *)defaultURL;

    Swift

    class func defaultURL() -> URL
  • A temporary URL in the applications caches folder. *

    Declaration

    Objective-C

    + (nonnull NSURL *)temporaryURL;

    Swift

    class func temporaryURL() -> URL
  • A temporary storage location in the applications caches folder. *

    Declaration

    Objective-C

    + (nonnull SBSDKStorageLocation *)temporaryLocation;

    Swift

    class func temporary() -> SBSDKStorageLocation
  • The base folder URL of the receiver. *

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSURL *baseURL;

    Swift

    var baseURL: URL? { get }