Skip to content

Conversation

@eimermusic
Copy link

This commit moves the disk cache root path (and domain identifier) into a config object you can swap out in your app delegate.

// in AppDelegate.swift
HanekeGlobals.config = Config(
    domain: "images",
    cacheRootPath: NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)[0]
)

I have a use-case where the cacheable images and video clips are ephemeral and one purpose of the iOS app is to allow local persistence of the data. I also saw that other users has posed questions in this direction. E.g. #423

I can also see my app wanting to expose these images to the Files app, which is why the domain identifier came along for the ride.

I am so impressed by the simplicity and performance of Haneke. I really wanted to keep getting the benefits of that while still providing persistent storage.

Thoughts?

@eimermusic
Copy link
Author

Totally forgot about the tests yesterday. I hope this makes travis happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant