Updated the migration guide

This commit is contained in:
Bogdan Poplauschi 2017-01-28 20:08:22 +02:00
parent 10a86a7b0e
commit de63b0730d
1 changed files with 16 additions and 4 deletions

View File

@ -27,16 +27,28 @@ With 4.0, the ones marked as `nullable` will be regular optionals, as the `nonnu
For details, read [Nullability and Objective-C](https://developer.apple.com/swift/blog/?id=25).
#### Simple case
#### Using the UI*View categories brings no change
SDWebImage 3.x
```
[imageView sd_setImageWithURL:url];
[imageView sd_setImageWithURL:url placeholderImage:placeholderImage];
```
SDWebImage 4.x
```
[imageView sd_setImageWithURL:url];
[imageView sd_setImageWithURL:url placeholderImage:placeholderImage];
```
#### Using directly SDWebImageManager
SDWebImage 3.x
```
[manager downloadImageWithURL:url options:options: progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { ... } ];
```
SDWebImage 4.x
```
[manager loadImageWithURL:url options:options: progress:nil completed:^(UIImage *image, NSData *imageData, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { ... } ];
```
### Entities
@ -183,4 +195,4 @@ SDWebImage 4.x
#### UIImage
- removed `sd_animatedGIFNamed:` or `sd_animatedImageByScalingAndCroppingToSize:`
- added `isGIF`
- added `sd_imageData` and `sd_imageDataAsFormat:`. Those methods transform a `UIImage` to the `NSData` representation
- added `sd_imageData` and `sd_imageDataAsFormat:`. Those methods transform a `UIImage` to the `NSData` representation