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

Supports the user to customize the default disk cache directory, which can be used to share cache for App && App Extension #3066

Merged
merged 3 commits into from Aug 13, 2020

Conversation

dreampiggy
Copy link
Contributor

@dreampiggy dreampiggy commented Aug 10, 2020

New Pull Request Checklist

  • I have read and understood the CONTRIBUTING guide

  • I have read the Documentation

  • I have searched for a similar pull request in the project and found none

  • I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)

  • I have added the required tests to prove the fix/feature I am adding

  • I have updated the documentation (if necessary)

  • I have run the tests and they pass

  • I have run the lint and it passes (pod lib lint)

This merge request fixes / refers to the following issues: close #3050

Pull Request Description

This PR solve the feature request from #3050.

If you want to change the shared image cache's path, use like this:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Insert code here to initialize your application
    SDImageCache.defaultImageCacheDirectory = [NSFileManager.defaultManager containerURLForSecurityApplicationGroupIdentifier:@"my.app.group.id"];
}

…h can be used to share cache for App && App Extension
@dreampiggy dreampiggy added this to the 5.9.0 milestone Aug 10, 2020
@dreampiggy dreampiggy changed the title Supports the user to customize the default disk cache directory, whic… Supports the user to customize the default disk cache directory, which can be used to share cache for App && App Extension Aug 10, 2020
@codecov
Copy link

codecov bot commented Aug 10, 2020

Codecov Report

Merging #3066 into master will decrease coverage by 0.43%.
The diff coverage is 47.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3066      +/-   ##
==========================================
- Coverage   83.57%   83.14%   -0.44%     
==========================================
  Files          69       70       +1     
  Lines        7605     7617      +12     
==========================================
- Hits         6356     6333      -23     
- Misses       1249     1284      +35     
Flag Coverage Δ
#ios 83.22% <50.00%> (-0.33%) ⬇️
#macos 83.22% <34.73%> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
SDWebImage/Core/NSData+ImageContentType.m 79.09% <ø> (-0.19%) ⬇️
SDWebImage/Core/SDImageAWebPCoder.m 0.00% <0.00%> (ø)
SDWebImage/Core/SDAnimatedImageRep.m 80.51% <20.00%> (-9.04%) ⬇️
SDWebImage/Core/SDImageHEICCoder.m 81.13% <50.00%> (+1.33%) ⬆️
SDWebImage/Core/SDImageIOAnimatedCoder.m 85.74% <91.66%> (+0.35%) ⬆️
SDWebImage/Core/SDImageCache.m 78.12% <100.00%> (+0.32%) ⬆️
SDWebImage/Core/SDImageIOCoder.m 88.70% <100.00%> (-0.25%) ⬇️
...DWebImage/Private/SDImageIOAnimatedCoderInternal.h 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40023d5...74a3d26. Read the comment docs.

@dreampiggy dreampiggy merged commit 09aee5f into SDWebImage:master Aug 13, 2020
@dreampiggy dreampiggy deleted the feature_default_cache_path branch August 13, 2020 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to change the cache directory of the sharedImageCache
2 participants