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

Refactor to generic Storage #189

Merged
merged 32 commits into from
Jun 13, 2018
Merged

Refactor to generic Storage #189

merged 32 commits into from
Jun 13, 2018

Conversation

onmyway133
Copy link
Contributor

@zenangst
Copy link
Contributor

Using document directory won’t work on tvOS I think. You should test that.

@onmyway133
Copy link
Contributor Author

@zenangst All tests have passed for both iOS and tvOS. Did you have a problem with tvOS ?

Copy link
Contributor

@vadymmarkov vadymmarkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onmyway133 Great work! We should update README as well to make it clear how to use the new API.

public extension DiskStorage {
func transform<U>(transformer: Transformer<U>) -> DiskStorage<U> {
// swiftlint:disable force_try
let storage = try! DiskStorage<U>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to use force try here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can improve this in the next PR

@onmyway133 onmyway133 merged commit 1432835 into master Jun 13, 2018
@onmyway133 onmyway133 deleted the refactor/generic_storage branch June 13, 2018 11:55
@vadymmarkov
Copy link
Contributor

@onmyway133 I think using Document directory by default is not a good idea, I would leave cache. Read #179 (comment). As for tvOS I think it won't work on the device.

@zenangst
Copy link
Contributor

zenangst commented Jun 13, 2018

@onmyway133 the problem is on device not in the simulator. I ran into issues that the app would throw and exception and crash when trying to store files in the app directory. However, it worked just fine in the simulator and tests. Just to be sure, I’d install it on a device just to make sure that everything is dandy and fine. It worked with cache before as it used the apps cache directory instead of documents, which is allowed to modify.

The issue with the cache directory is that images etc will be wiped the next time the application will run. Maybe that is something that is desired but it kinda throws the expiration feature out the window.

@onmyway133
Copy link
Contributor Author

@zenangst Yeah thanks for the advice. I've set back to using document directory. We have configuration with custom directory so I think that should be fine for user with more customised scenario.

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.

3 participants