Set version to 5.0.0-beta, Xcode 8 required, updated the CHANGELOG and added 5.0 Migration Guide

This commit is contained in:
Bogdan Poplauschi 2018-04-11 11:41:08 +03:00
parent 76215d7717
commit 153af72369
5 changed files with 228 additions and 4 deletions

View File

@ -1,3 +1,53 @@
## [5.0.0 - Release_name_TBD, on Apr xxth, 2018](https://github.com/rs/SDWebImage/releases/tag/5.0.0-beta)
See [all tickets marked for the 5.0.0 release](https://github.com/rs/SDWebImage/milestone/15)
#### Infrastructure
- the new requirements are **iOS 8.0+** and **macOS 10.10+** #2147
#### Backwards incompatible changes
See the [5.0 Migration Guide](Docs/SDWebImage-5.0-Migration-guide.md) for a list of comprehensive changes and the way to update your code
#### Features
- Introduce `SDAnimatedImageView`, `SDAnimatedImage` and refactor the way we handle animated images #2140
- Added APNG support via dedicated coder `SDWebImageAPNGCoder` #2149
- Refactored `SDWebImageDownloader` configs, separated them into a dedicated `SDWebImageDownloaderConfig` object #2263
- Refactored the way we work with the scale factor #2266
- Created request and response modifier #2261
- Refactor Cache Path API #2276
- Refactor custom cache serializer & headers filter for request level #2280
- Refactor cache - Support custom memory cache & disk cache #2282
- Refactor cache - Support custom web cache #2278
- Refactor - custom image loader - Supports loader protocol #2256
- Use `SDWebImageAvoidDecodeImage` to allow user to control force decode feature for individual image request #2283
- `SDImageCache` supports disk cache writing options. See `SDImageCacheConfig diskCacheWritingOptions` #2148
- `SDImageCache` now uses `NSData writeToFile:options:error` instead of `NSFileManager createFileAtPath:contents:attributes` #2148
- Moved `SDImageCache maxMemoryCost` and `SDImageCache maxMemoryCountLimit` to `SDImageCacheConfig` #2151
- Added `SDImageCache diskImageDataExistsWithKey:` synchronous method #2151
- Moved `UIImage sd_imageLoopCount` and `UIImage isGIF` (and renamed to `sd_isAnimated`) to `UIImage+WebCache` category, removed the outdated methods #2152
- Move context and other type definitions to a separate header (`SDWebImageDefine`) to allow to be included without dependency #2188
- Pass `context` arg from the top level APIs to the bottom level APIs to allow specify logic in the future #2189 d6a3e2c c24c3d3
- Refactor the image indicator by creating `SDWebImageIndicator` and `SDWebImageProgressIndicator` protocols and two concrete classes that implement activity and progress indicators for both UIKit and AppKit #2185 46b62cf
- Refactor the implementation of `SDWebImagePrefetcher` so it behaves more like a "shared instance" object, similar to other platform classes. Each instance will manage its own list of urls. #2191 1efc247 92f3d2c bc164d6
- Refactored and enhanced the way we allow image transformations. Switched from a single delegate method to composition of `SDWebImageTransformer` #2219
- API style refactoring - #2250
- Use property instead of setters and getters to make the property available in Swift
- Use class property with the correct name instead of `+(instanceType)sharedInstance` in singleton to make it more easy to use in Swift. The generated interface should be simple `open class var shared { get }`
- Add all nullability annotation to avoid any `AnyObject!` implicitly unwrapped optionals (Except that `null_resettable`)
- Add all Core Foundation Ownership using `CF_RETURNS_RETAINED` for
Get Rule and `CF_RETURNS_NOT_RETAINED` for Create Rule to avoid any `Unmanaged` CF value
- Change all key for Dictionary with `NS_STRING_ENUM` to make it easy to use in Swift with dot syntax
- Change all global value type which represent enum with `NS_TYPED_ENUM` to make it easy to use in Swift with dot syntax
- Remove the extra calculation of image orientation for ImageIO coder & Fix macOS image orientation #2271
- Added `SDWebImageError` (defined as `NS_ERROR_ENUM`) to group all our errors together #2290
- Added tests for macOS
#### Fixes
- `SDWebImageManager loadImageWithURL:options:progress:completed:` changed the `completed` param requirement from `nullable` to `nonnull` #2164
TODO: Update diagrams
## [4.4.1 - 4.4 patch, on June 7th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.4.1)
See [all tickets marked for the 4.4.1 release](https://github.com/rs/SDWebImage/milestone/26)

View File

@ -0,0 +1,173 @@
## SDWebImage 5.0 Migration Guide
SDWebImage 5.0 is the latest major release of SDWebImage, a top library for downloading and caching images.
As a major release, following [Semantic Versioning](http://semver.org/) conventions, 5.0 introduces several API-breaking changes with its new architecture.
.... RELEASE_SUMMARY ....
This guide is provided in order to ease the transition of existing applications using SDWebImage 4.X to the latest APIs, as well as explain the design and structure of new and changed functionality.
### Requirements: iOS 8, Mac OS X 10.10, watchOS 2, tvOS 9, Xcode 8
SDWebImage 5.0 officially supports iOS 8 and later, Mac OS X 10.10 and later, watchOS 2 and later and tvOS 9 and later.
It needs Xcode 8 or later to be able to build everything properly.
For targeting previous versions of the SDKs, check [README - Backwards compatibility](https://github.com/rs/SDWebImage#backwards-compatibility)
.
### Migration
#### Swift
#### Objective-C
example
SDWebImage 4.x
```
[imageView sd_setImageWithURL:url placeholderImage:placeholderImage];
```
SDWebImage 5.x
```
[imageView sd_setImageWithURL:url placeholderImage:placeholderImage];
```
### Entities
#### Added
...
#### SDImageCache
- new initializer `initWithNamespace:diskCacheDirectory:config:`, is now the designated initializer
- moved `maxMemoryCost` and `maxMemoryCountLimit` to `SDImageCacheConfig`
- added `SDImageCache diskImageDataExistsWithKey:` synchronous method
- `addReadOnlyCachePath:` removed, use `additionalCachePathBlock` instead
- `cachePathForKey:inPath:` removed, use `cachePathForKey:` with NSString's path API instead.
- `defaultCachePathForKey:` removed, use `cachePathForKey:` instead
#### SDImageCacheConfig
- added `diskCacheWritingOptions` of type `NSDataWritingOptions`, defaults to `NSDataWritingAtomic`
- added `maxMemoryCost` and `maxMemoryCountLimit` properties (used to be in `SDImageCache`)
- `shouldDecompressImages` removed. Use `SDImageCacheAvoidDecodeImage` in cache options instead
#### SDWebImageManager
- `loadImageWithURL:options:progress:completed:` changed the `completed` param requirement from `nullable` to `nonnull`
- `loadImageWithURL:options:progress:completed:` return type `id<SDWebImageOperation>` changed to `SDWebImageCombinedOperation *`
- `shared()` changed to `shared`
- `isRunning()` changed to `isRunning`
- `imageCache` changed from nullable to nonnull
- `imageDownloader` renamed to `imageLoader` and changed from nullable to nonnull
- `cacheKeyFilter` property type changed to `id<SDWebImageCacheKeyFilter>`, use the `SDWebImageCacheKeyFilter cacheKeyFilterWithBlock:`
- `cacheSerializer` property type CHANGED to `id<SDWebImageCacheSerializer>`, use the `SDWebImageCacheSerializer cacheSerializerWithBlock:`
- `imageCache` property type changed from `SDImageCache *` to `id<SDImageCache>`. The default value does not change.
- `initWithCache:downloader:` 's `cache` arg type changed from `SDImageCache *` to `id<SDImageCache>`
- `initWithCache:downloader` renamed to `initWithCache:loader:`
- `saveImageToCache:forURL:` removed. Use `SDImageCache storeImage:imageData:forKey:cacheType:completion:` (or `SDImageCache storeImage:forKey:toDisk:completion:` if you use default cache class) with `cacheKeyForURL:` instead.
- `diskImageExistsForURL:completion:` removed. Use `SDImageCache containsImageForKey:cacheType:completion:` (or `SDImageCache diskImageExistsWithKey:completion:` if you use default cache class) with `cacheKeyForURL:` instead.
- `cachedImageExistsForURL:completion` removed. Use `SDImageCache containsImageForKey:cacheType:completion:` (or `SDImageCache diskImageExistsWithKey:completion:` and `SDImageCache imageFromMemoryCacheForKey:` if you use default cache class) with `cacheKeyForURL:` instead.
#### SDWebImageManagerDelegate
- removed `imageManager:transformDownloadedImage:forKey:`
#### UIView and subclasses (UIImageView, UIButton, ...)
- `sd_internalSetImageWithURL:placeholderImage:options:operationKey:setImageBlock:progress:completed:` renamed to `UIView sd_internalSetImageWithURL:placeholderImage:options:context:setImageBlock:progress:completed:` (The biggest changes is that the completion block type from `SDExternalCompletionBlock` to `SDInternalCompletionBlock`. Which allow advanced user to get more information of image loading process)
- `sd_internalSetImageWithURL:placeholderImage:options:operationKey:setImageBlock:progress:completed:context:` removed
- activity indicator refactoring - use `sd_imageIndicator` with `SDWebImageActivityIndicator`
- `sd_setShowActivityIndicatorView:` removed
- `sd_setIndicatorStyle:` removed
- `sd_showActivityIndicatorView` removed
- `sd_addActivityIndicator:` removed
- `sd_removeActivityIndicator:` removed
#### UIImage
- Renamed `isGIF` to `sd_isAnimated`, also `NSImage isGIF` renamed to `NSImage sd_isAnimated`
- Renamed `decodedImageWithImage:` to `sd_decodedImageWithImage:`
- Renamed `decodedAndScaledDownImageWithImage:` to `sd_decodedAndScaledDownImageWithImage:`
- Removed `sd_webpLoopCount` since we have `sd_imageLoopCount`
#### UIImageView
- Removed `sd_setImageWithPreviousCachedImageWithURL:placeholderImage:options:progress:completed`
#### SDWebImageDownloader
- `shared()` changed to `shared`
- `setOperationClass` available for Swift user
- `setSuspended(_:)` changed to `isSuspended` property
- `shouldDecompressImages` moved to `SDWebImageDownloaderConfig.shouldDecompressImages`
- `maxConcurrentDownloads` moved to `SDWebImageDownloaderConfig.maxConcurrentDownloads`
- `downloadTimeout` moved to `SDWebImageDownloaderConfig.downloadTimeout`
- `operationClass` moved to `SDWebImageDownloaderConfig.operationClass`
- `executionOrder` moved to `SDWebImageDownloaderConfig.executionOrder`
- `urlCredential` moved to `SDWebImageDownloaderConfig.urlCredential`
- `username` moved to `SDWebImageDownloaderConfig.username`
- `password` moved to `SDWebImageDownloaderConfig.password`
- `initWithSessionConfiguration:` removed, use `initWithConfig:]` with session configuration instead
- `createNewSessionWithConfiguration:` removed, use `initWithConfig:]` with new session configuration instead. To modify shared downloader configuration, provide custom `SDWebImageDownloaderConfig.defaultDownloaderConfig` before it created.
- `headersFilter` removed, use `requestModifier` instead
- `cancel:` removed, use `SDWebImageDownloadToken cancel` instead
- `shouldDecompressImages` removed. Use `SDWebImageDownloaderAvoidDecodeImage` in downloader options instead
#### SDWebImageDownloaderOperation
- `initWithRequest:inSession:options:context:` is now the designated initializer
- Removed `shouldUseCredentialStorage` property
- `SDWebImageDownloadOperationInterface` protocol renamed to `SDWebImageDownloadOperation`. (`SDWebImageDownloadOperationProtocol` for Swift)
- `expectedSize` removed, use `response.expectedContentLength` instead
- `shouldDecompressImages` removed. Use `SDWebImageDownloaderAvoidDecodeImage` in downloader options instead.
#### SDWebImagePrefetcher
- `prefetchURLs:` and `prefetchURLs:progress:completed:` return types changed from `void` to `SDWebImagePrefetchToken`
- `prefetcherQueue` property renamed to `delegateQueue`
- `maxConcurrentDownloads` property removed, use `SDWebImageManager.downloader` config instead
#### SDWebImageCoder
- `SDCGColorSpaceGetDeviceRGB()` moved to `SDWebImageCoderHelper colorSpaceGetDeviceRGB`
- `SDCGImageRefContainsAlpha()`, moved to `SDWebImageCoderHelper imageRefContainsAlpha:`
- `decodedImageWithData:` replaced with `decodedImageWithData:options:`
- `encodedDataWithImage:format:` replaced with `encodedDataWithImage:format:options`
- `init` method from `SDWebImageProgressiveCoder` changed to `initIncrementalWithOptions:`
- `incrementalDecodedImageWithData:finished` replaced with `updateIncrementalData:finished` and `incrementalDecodedImageWithOptions:`
- removed `decompressedImage:data:options`
#### SDWebImageCodersManager
- `sharedInstance()` changed to `shared`
#### SDWebImageImageIOCoder
- `shared()` changed to `shared`
#### SDWebImageGIFCoder
- `shared()` changed to `shared`
#### SDWebImageWebPCoder
- `shared()` changed to `shared`
#### NSData-ImageContentType
- `sd_UTTypeFromSDImageFormat` return `CFString` instead of `Unmanaged<CFString>`
#### UIButton-WebCache
- `sd_currentImageURL()` changed to `sd_currentImageURL`
#### NSButton-WebCache
- `sd_currentImageURL()` changed to `sd_currentImageURL`
- `sd_currentAlternateImageURL()` changed to `sd_currentAlternateImageURL`
#### Constants
- `SDWebImageInternalSetImageGroupKey` renamed to `SDWebImageContextSetImageGroup`
- `SDWebImageExternalCustomManagerKey` renamed to `SDWebImageContextCustomManager`

View File

@ -41,7 +41,7 @@ This library provides an async image downloader with cache support. For convenie
#### Backwards compatibility
- For iOS 7 and macOS 10.9, use [any 4.x version up to 4.3.3](https://github.com/rs/SDWebImage/releases/tag/4.3.3)
- For iOS 7, macOS 10.9 or Xcode < 8, use [any 4.x version up to 4.3.3](https://github.com/rs/SDWebImage/releases/tag/4.3.3)
- For macOS 10.8, use [any 4.x version up to 4.3.0](https://github.com/rs/SDWebImage/releases/tag/4.3.0)
- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/rs/SDWebImage/tag/3.7.6)
- For iOS < 5.0, please use the last [2.0 version](https://github.com/rs/SDWebImage/tree/2.0-compat).
@ -53,6 +53,7 @@ This library provides an async image downloader with cache support. For convenie
- Read the [Documentation @ CocoaDocs](http://cocoadocs.org/docsets/SDWebImage/)
- Try the example by downloading the project from Github or even easier using CocoaPods try `pod try SDWebImage`
- Read the [Installation Guide](https://github.com/rs/SDWebImage/wiki/Installation-Guide)
- Read the [SDWebImage 5.0 Migration Guide](Docs/SDWebImage-5.0-Migration-guide.md) to get an idea of the changes from 4.x to 5.x
- Read the [SDWebImage 4.0 Migration Guide](Docs/SDWebImage-4.0-Migration-guide.md) to get an idea of the changes from 3.x to 4.x
- Read the [Common Problems](https://github.com/rs/SDWebImage/wiki/Common-Problems) to find the solution for common problems
- Go to the [Wiki Page](https://github.com/rs/SDWebImage/wiki) for more information such as [Advanced Usage](https://github.com/rs/SDWebImage/wiki/Advanced-Usage)

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SDWebImage'
s.version = '4.4.1'
s.version = '5.0.0-beta'
s.osx.deployment_target = '10.10'
s.ios.deployment_target = '8.0'

View File

@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.4.1</string>
<string>5.0.0-beta</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.4.1</string>
<string>5.0.0-beta</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>