4.0.0 Beta
Pre-release
Pre-release
bpoplauschi
released this
05 Oct 09:27
·
2477 commits
to master
since this release
See all tickets marked for the 4.0.0 release
Infrastructure:
- support for watchOS and OS X platforms #1595
- the
SDWebImage xcodeproj
contains the following targets:SDWebImage iOS static
(iOS static lib)SDWebImage watchOS static
(watchOS static lib)SDWebImage OSX
(OSX dynamic framework)SDWebImage iOS
(iOS dynamic framework)SDWebImage tvOS
(tvOS dynamic framework)SDWebImage watchOS
(watchOS dynamic framework)- the
SDWebImage Demo xcodeproj
contains the following targets:SDWebImage OSX Demo
SDWebImage iOS Demo
SDWebImage TV Demo
SDWebImage Watch Demo
- bumped
libwep
version to0.5.1
- improved unit testing code coverage (35% -> 77%) and integrated CodeCov
Backwards incompatible changes
- removed all deprecated methods (that we carried around for backwards compatibility in previous versions) #774
- Renamed
SDWebImageManager
downloadImageWithURL:options:progress:completed:
toloadImageWithURL:options:progress:completed:
as it makes more sense, since we check the cache first and download only if needed a32a177 - Deleted targets:
SDWebImage+MKAnnotation
,SDWebImage+WebP
,SDWebImageFramework
:SDWebImage
target that build as a static library (all subspecs included) ->libSDWebImage.a
SDWebImageiOS
andSDWebImagetvOS
targets that build as dynamic frameworks
- Renamed the dynamic frameworks targets from
WebImage
toSDWebImage
. Renamed theWebImage.h
toSDWebImage.h
to match the framework naming - Renamed the schemes for consistency. Updated the Tests Podfile + project.
- For #883 Fix multiple requests for same image and then canceling one, several breaking changes were needed:
SDWebImageDownloader
method- downloadImageWithURL:options:progress:completed:
now returns aSDWebImageDownloadToken *
instead ofid <SDWebImageOperation>
(give the ability to cancel downloads using the returned token)SDWebImageDownloaderOperation
initializer- initWithRequest:options:progress:completed:cancelled
split into- initWithRequest:options
andaddHandlersForProgress:completed:
. Note: there is no more cancel block
- Modern Objective-C syntax done in 64382b9 includes:
- initializers now return
instancetype
instead ofid
- explicit designated initializers (i.e. for
SDImageCache
)
- initializers now return
- For #1575 GIF support using FLAnimatedImage, several changes were needed:
- replaced type
SDWebImageQueryCompletedBlock
withSDCacheQueryCompletedBlock
and added anNSData *
param - because of the change above, the
done
param ofSDImageCache
queryDiskCacheForKey:done:
is now aSDCacheQueryCompletedBlock
and those blocks must now include anNSData *
param - replaced type
SDWebImageCompletionWithFinishedBlock
withSDInternalCompletionBlock
and added anNSData *
param - because of the change above, the
completed
param ofSDWebImageManager
loadImageWithURL:options:progress:completed:
is nowSDInternalCompletionBlock
and those blocks must now include anNSData *
param - for consistency with the previous change, also renamed
SDWebImageCompletionBlock
toSDExternalCompletionBlock
UIImage
will no longer respond tosd_animatedGIFNamed:
orsd_animatedImageByScalingAndCroppingToSize:
- replaced type
- Xcode 7 Objective-C updates (Lightweight Generics and Nullability) #1581
- breaks compatibility at least for Swift users of the framework
- watchOS and OS X support #1595 required
- renamed
SDWebImage
iOS static lib target toSDWebImage iOS static
for clarity
- renamed
- improving the unit tests code coverage #1681 required
- Refactored
NSData
ImageContentType
category, instead of returning the contentType as a string, the new added methodsd_imageFormatForImageData
will return aSDImageFormat
enum value SDImageCache
configuration properties moved intoSDImageCacheConfiguration
(which is now available viaconfig
property):shouldDecompressImages
shouldDisableiCloud
shouldCacheImagesInMemory
maxCacheAge
maxCacheSize
- The
storeImage:
methods fromSDImageCache
were async already, but declared as sync. Properly marked them as async + added completion. Got rid of the recalculate param. If theNSData
is provided, use it. Otherwise, recalculate from theUIImage
- Removed the synchronous methods
diskImageExistsForURL:
andcachedImageExistsForURL:
fromSDWebImageManager
- Removed the synchronous method
diskImageExistsWithKey:
fromSDImageCache
- Get rid of the confusion caused by
cleanDisk
andclearDisk
onSDImageCache
. RenamedcleanDisk
todeleteOldFiles
. No longer expose the syncclearDisk
anddeleteOldFiles
, just the async ones. - Renamed
SDImageCache
queryDiskCacheForKey:done:
toqueryCacheOperationForKey:done:
- Another
SDImageCache
clarification:imageFromDiskCacheForKey:
used to also check the memory cache which I think is misleading. NowimageFromDiskCacheForKey
only checks the disk cache and the new methodimageFromCacheForKey
checks both caches - Got rid of
removeImageForKey:
andremoveImageForKey:fromDisk:
fromSDImageCache
that looked sync but were async. Left only the 2 async ones - Removed
UIImageView
sd_cancelCurrentHighlightedImageLoad
- Refactored
- Added
sd_
prefix to the activity indicator related methods (setShowActivityIndicatorView:
,setIndicatorStyle:
,showActivityIndicatorView
,addActivityIndicator
,removeActivityIndicator
) #1640 - Use
dispatch_main_async_safe
for all the completion blocks on the main queue (used to bedispatch_sync
) - avoiding locks. - Removed
dispatch_main_sync_safe
as it can be mistakenly used - Add
url
as param to progress blockSDWebImageDownloaderProgressBlock
- #984
Features:
- Switched our GIF support to a better implementation: FLAnimatedImage by Flipboard #1575
- requires iOS 8+ (it's the only way due to FLAnimatedImage requirements)
- the implementation relies on a
WebCache
category on top ofFLAnimatedImageView
- details in the README
- Converted any remaining code to Modern Objective-C syntax - 64382b9
- Xcode 7 Objective-C updates (Lightweight Generics and Nullability) #1581
- via #1595 Clarified and simplified the usage of
TARGET_OS_*
macros. AddedSD_MAC
,SD_UIKIT
,SD_IOS
,SD_TV
,SD_WATCH
. The biggest issue here wasTARGET_OS_MAC
was 1 for all platforms and we couldn't rely on it. - Replaces #1398 Allow to customise cache and image downloader instances used with
SDWebImageManager
- added a new initializer (initWithCache:downloader:
) 9112170 UIImage
responds tosd_imageData
andsd_imageDataAsFormat:
via theMultiFormat
category. Those methods transform aUIImage
to theNSData
representation 82d1f2e- Created
SDWebImageDownloaderOperationInterface
to describe the behavior of a downloader operation. Any custom operation must conform to this protocol df3b6a5 - Refactored all the duplicate code from our
WebCache
categories into aUIView
WebCache
category. All the other categories will make calls to this one. Customization of setting the image is done via thesetImageBlock
and theoperationKey
e1840c3 - Due to the change above, the activity indicator can now be added to
UIButton
,MKAnnotationView
,UIImageView
- Animated WebP support #1438
- The shared objects (not really singletons) should allow subclassing, therefore the return type of the shared resource method should be
instancetype
and not a fixed type - c57cf7e - Allow to specify
NSURLSessionConfiguration
forSDWebImageDownloader
#1654 - Add
url
as param to progress blockSDWebImageDownloaderProgressBlock
- #984
Fixes:
- Fix multiple requests for same image and then canceling one #883 + 8a78586
- Fixed #1444 and the master build thanks to @kenmaz
- Fixed an issue with the
SDWebImageDownloaderOperation
:cancelInternal
was not called because of the old mechanism rellying on thethread
property - probably because that thread did not have a runloop. Removed that and now cancelInternal is called as expected f4bdae6 - Replaced #781 on replacing dispatch_sync with dispatch_async for the main queue 062e50a f7e8246 c77adf4 fdb8b2c 265ace4 0c47bc3. Check for main queue instead of main thread.
- Fixed #1619 iOS 10 crash (
setObjectForKey: object cannot be nil
) - #1676 7940577 - Fixed #1326 #1424 (
Carthage bitcode issue
) - #1593 - Fixed #1639 via #1657 (
Add support for downloading images behind redirect
) - Replaced #1537 via 9cd6779 - fixed a potential retain cycle
- Updated
dispatch_main_async_safe
macro in order to avoid redefinition when included as Pod - Fixed #1089 by updating the docs on the calling queue for the
progressBlock
(background queue) - Fixed a compilation issue on
FLAnimatedImageView+WebCache
- #1687