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
Move the imageLoopCount and isAnimated into UIImage+WebCache file, removed the outdated methods #2152
Move the imageLoopCount and isAnimated into UIImage+WebCache file, removed the outdated methods #2152
Conversation
21ee138
to
41cd76b
Compare
41cd76b
to
daecb24
Compare
Codecov Report
@@ Coverage Diff @@
## 5.x #2152 +/- ##
==========================================
+ Coverage 80.53% 80.57% +0.03%
==========================================
Files 36 37 +1
Lines 3586 3588 +2
Branches 320 321 +1
==========================================
+ Hits 2888 2891 +3
+ Misses 675 674 -1
Partials 23 23
Continue to review full report at Codecov.
|
This seems not really useful if we want to make it easier to migrate from 4.x to 5.x. So I decide to directly remove that API instead of a deprecation in 4.3.x and removal in 5.x. |
daecb24
to
9f5906e
Compare
Current break change (Need change code)UIImage+MultiFormat.h
UIImage+ForceDecode.h
UIImage+GIF.h
NSImage+WebCache.h
Already Deprecated and RemoveUIImage+WebP.h
SDWebImageDownloaderOperation.h
UIImageView+WebCache.h
|
bedec93
to
1d19e5a
Compare
@@ -37,6 +37,6 @@ typedef NS_ENUM(NSInteger, SDImageFormat) { | |||
@param format Format as SDImageFormat | |||
@return The UTType as CFStringRef | |||
*/ | |||
+ (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format; | |||
+ (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format CF_RETURNS_NOT_RETAINED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually follow the GET rules on Core Foundation, mark this to avoid Swift user use a Unmanaged
check
@param image The image to be decompressed | ||
@return The decompressed image | ||
*/ | ||
+ (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use category prefix here to avoid name conflict
SDWebImage/UIView+WebCache.h
Outdated
*/ | ||
- (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style; | ||
@property (nonatomic, assign) UIActivityIndicatorViewStyle sd_activityIndicatorStyle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These change to make the API more suitable for Swift and Objective-C user. Use method is little wired :)
I'll try to create a new class for indicator. Current design is bad for extension and more flexible
1d19e5a
to
5c164d1
Compare
…moved the outdated methods
… used for a long time
5c164d1
to
1021245
Compare
bac5b1e
to
f1caf8f
Compare
Looks good to me. Cheers for better APIs. 🍻 |
…use property based API, which more suitable for Swift
cde5d5f
to
d4daca3
Compare
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 / reffers to the following issues: ...
Pull Request Description
Our current
UIImage+GIF
seems out of date. ThatisGIF
is not related to GIF image format but whether it's animated. So, instead, I think we should use a more common property to let user know current image is animated.We introduce
sd_isAnimated
to indicate whether the image instance is animated image or not. And also, we previously put those category property anywhere. For example,sd_imageLoopCount
is inUIImage+MultiFormat
, which should be format related but not image loop count or animated related. So we make it more clear.Attention, that previous
NSImage+WebCache
will resolve a dumplicate symbol because UIImage is defined as NSImage on macOS. SoUIImage+WebCache
should also be use for NSImage. Therefore, theNSImage+WebCache.h
file should remove that declaration, we seperate the helper method toNSImage+Addtions
which provide convenience method for cross-platform code.And also, this PR changes some not really good API for Swift with the
NS_SWIFT_NAME
and change some method declaration to property, this can make that more easy to use on Swift.