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

feat(ios): optimize method loadImage:completed: #3626

Closed
wants to merge 1 commit into from

Conversation

Geor9eLau
Copy link

In the protocol of HippyImageViewCustomLoader, there is a method called loadImage:completed:. As an iOS developer, we usually use SDWebImage to implement this interface. The loadImage(_:completed:) method is implemented using the loadImage(with:options:progress:completed:) method provided by SDWebImageManager.

 [SDWebImageManager.sharedManager loadImageWithURL:url options:0 progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { completedBlock(data, url, error,  !!cacheType); }];

However, this implementation encountered some exceptions in practical scenarios. When the loaded image is found in the memory cache, the image parameter in the callback of the SDWebImageManager method has a value, but the data parameter is empty. This causes the image to fail to load in the application.

Therefore, aligning the interface with SDWebImage and internally handling this scenario will make it more convenient for integrators to implement and avoid encountering the same issue as I did.

@github-actions github-actions bot added framework: ios size: s Denotes a PR that changes 10-99 lines labels Nov 21, 2023
Copy link

hippy-service bot commented Nov 21, 2023

Hi, @Geor9eLau. Thanks for your PR! 👏

🏷️ You can leave a comment in this PR with #help tag when you need help (e.g. some status checks run failed due to internal issue), admin team members will help asap.

Copy link

hippy-service bot commented Nov 21, 2023

After a quick scan, I have approved workflow to run.

🏷️ New commits in this PR would not be tested automatically until this pull request is reviewed by our collaborators.
🏷️ No need to worry about the status of merge_guard and [gh] pull request merge guard / merge_guard (pull_request_target) checks, once this pull request is met merge requirements, it will be automatically converted to successful status.

Copy link

hippy-service bot commented Jan 20, 2024

Pay attention 🛎️ !!
There has been no activity on this PR for 2 months, so I will label it stalled.
It will be automatically closed in 30 days if no more activity. Feel free to leave a comment if you have any questions.

@hippy-service hippy-service bot added the stale: 60d No interaction in the last 60 days label Jan 20, 2024
@wwwcg wwwcg removed the request for review from ozonelmy January 24, 2024 12:47
@hippy-service hippy-service bot removed the stale: 60d No interaction in the last 60 days label Jan 24, 2024
Copy link

hippy-service bot commented Mar 24, 2024

Pay attention 🛎️ !!
There has been no activity on this PR for 2 months, so I will label it stalled.
It will be automatically closed in 30 days if no more activity. Feel free to leave a comment if you have any questions.

@hippy-service hippy-service bot added the stale: 60d No interaction in the last 60 days label Mar 24, 2024
Copy link

hippy-service bot commented May 24, 2024

Sorry, closing this PR because it has stalled for over 4 months.
Feel free to reopen if this PR is still relevant, or to ping the collaborator if you have any questions.

@hippy-service hippy-service bot added the stale: closed Closed due to stale label May 24, 2024
@hippy-service hippy-service bot closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework: ios size: s Denotes a PR that changes 10-99 lines stale: closed Closed due to stale stale: 60d No interaction in the last 60 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant