Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] fix image slide bug (#1715)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhan-he authored and cxfeng1 committed Nov 6, 2018
1 parent e6c3533 commit df1a867
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ - (void)readyToRender

- (void)cancelImage
{
if ([[self imageLoader] respondsToSelector:@selector(cancelCurrentImageLoad:)]) {
[[self imageLoader] cancelCurrentImageLoad:(UIImageView*)_view];
}
[_imageOperation cancel];
_imageOperation = nil;
[_placeholderOperation cancel];
Expand Down
5 changes: 5 additions & 0 deletions ios/sdk/WeexSDK/Sources/Protocol/WXImgLoaderProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,9 @@ typedef NS_ENUM(NSInteger, WXImageLoaderCacheType) {
progress:(void(^)(NSInteger receivedSize, NSInteger expectedSize))progressBlock
completed:(void(^)(UIImage *image, NSError *error, WXImageLoaderCacheType cacheType, NSURL *imageURL))completedBlock;

/**
* Cancel the current download image
*/
- (void)cancelCurrentImageLoad:(UIImageView*)imageView;

@end

0 comments on commit df1a867

Please sign in to comment.