diff --git a/SDWebImageSwiftUI/Classes/AnimatedImage.swift b/SDWebImageSwiftUI/Classes/AnimatedImage.swift index 4f9c4e9..d5df9c1 100644 --- a/SDWebImageSwiftUI/Classes/AnimatedImage.swift +++ b/SDWebImageSwiftUI/Classes/AnimatedImage.swift @@ -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. diff --git a/SDWebImageSwiftUI/Classes/ImageManager.swift b/SDWebImageSwiftUI/Classes/ImageManager.swift index 8d90f83..f5aaaef 100644 --- a/SDWebImageSwiftUI/Classes/ImageManager.swift +++ b/SDWebImageSwiftUI/Classes/ImageManager.swift @@ -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. diff --git a/SDWebImageSwiftUI/Classes/WebImage.swift b/SDWebImageSwiftUI/Classes/WebImage.swift index e435335..ba1fad0 100644 --- a/SDWebImageSwiftUI/Classes/WebImage.swift +++ b/SDWebImageSwiftUI/Classes/WebImage.swift @@ -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.