Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic config object allowing disk path to be configured #434

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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