Merge pull request #169 from SDWebImage/api_remove
Remove the wrong design onSuccess API. Using the full params one instead
This commit is contained in:
commit
b26da2eed6
|
@ -736,28 +736,6 @@ extension AnimatedImage {
|
|||
return self
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image. If `action` is `nil`, the call has no effect.
|
||||
/// - Returns: A view that triggers `action` when this image load successes.
|
||||
public func onSuccess(perform action: @escaping (PlatformImage) -> Void) -> AnimatedImage {
|
||||
self.imageHandler.successBlock = { image, _, _ in
|
||||
action(image)
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image, the second arg is the cache type loaded from. If `action` is `nil`, the call has no effect.
|
||||
/// - Returns: A view that triggers `action` when this image load successes.
|
||||
public func onSuccess(perform action: @escaping (PlatformImage, SDImageCacheType) -> Void) -> AnimatedImage {
|
||||
self.imageHandler.successBlock = { image, _, cacheType in
|
||||
action(image, cacheType)
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image, the second arg is the loaded image data, the third arg is the cache type loaded from. If `action` is `nil`, the call has no effect.
|
||||
|
|
|
@ -124,24 +124,6 @@ extension ImageManager {
|
|||
self.failureBlock = action
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image. If `action` is `nil`, the call has no effect.
|
||||
public func setOnSuccess(perform action: @escaping (PlatformImage) -> Void) {
|
||||
self.successBlock = { image, _, _ in
|
||||
action(image)
|
||||
}
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image, the second arg is the cache type loaded from. If `action` is `nil`, the call has no effect.
|
||||
public func setOnSuccess(perform action: @escaping (PlatformImage, SDImageCacheType) -> Void) {
|
||||
self.successBlock = { image, _, cacheType in
|
||||
action(image, cacheType)
|
||||
}
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image, the second arg is the loaded image data, the third arg is the cache type loaded from. If `action` is `nil`, the call has no effect.
|
||||
|
|
|
@ -238,29 +238,6 @@ extension WebImage {
|
|||
return self
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image. If `action` is `nil`, the call has no effect.
|
||||
/// - Returns: A view that triggers `action` when this image load successes.
|
||||
public func onSuccess(perform action: @escaping (PlatformImage) -> Void) -> WebImage {
|
||||
let action = action
|
||||
self.imageManager.successBlock = { image, _, _ in
|
||||
action(image)
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image, the second arg is the cache type loaded from. If `action` is `nil`, the call has no effect.
|
||||
/// - Returns: A view that triggers `action` when this image load successes.
|
||||
public func onSuccess(perform action: @escaping (PlatformImage, SDImageCacheType) -> Void) -> WebImage {
|
||||
self.imageManager.successBlock = { image, _, cacheType in
|
||||
action(image, cacheType)
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
/// Provide the action when image load successes.
|
||||
/// - Parameters:
|
||||
/// - action: The action to perform. The first arg is the loaded image, the second arg is the loaded image data, the third arg is the cache type loaded from. If `action` is `nil`, the call has no effect.
|
||||
|
|
Loading…
Reference in New Issue