Skip to content

Commit b26da2e

Browse files
authored
Merge pull request #169 from SDWebImage/api_remove
Remove the wrong design onSuccess API. Using the full params one instead
2 parents af644e4 + 59a9614 commit b26da2e

File tree

3 files changed

+0
-63
lines changed

3 files changed

+0
-63
lines changed

SDWebImageSwiftUI/Classes/AnimatedImage.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -736,28 +736,6 @@ extension AnimatedImage {
736736
return self
737737
}
738738

739-
/// Provide the action when image load successes.
740-
/// - Parameters:
741-
/// - action: The action to perform. The first arg is the loaded image. If `action` is `nil`, the call has no effect.
742-
/// - Returns: A view that triggers `action` when this image load successes.
743-
public func onSuccess(perform action: @escaping (PlatformImage) -> Void) -> AnimatedImage {
744-
self.imageHandler.successBlock = { image, _, _ in
745-
action(image)
746-
}
747-
return self
748-
}
749-
750-
/// Provide the action when image load successes.
751-
/// - Parameters:
752-
/// - 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.
753-
/// - Returns: A view that triggers `action` when this image load successes.
754-
public func onSuccess(perform action: @escaping (PlatformImage, SDImageCacheType) -> Void) -> AnimatedImage {
755-
self.imageHandler.successBlock = { image, _, cacheType in
756-
action(image, cacheType)
757-
}
758-
return self
759-
}
760-
761739
/// Provide the action when image load successes.
762740
/// - Parameters:
763741
/// - 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.

SDWebImageSwiftUI/Classes/ImageManager.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,6 @@ extension ImageManager {
124124
self.failureBlock = action
125125
}
126126

127-
/// Provide the action when image load successes.
128-
/// - Parameters:
129-
/// - action: The action to perform. The first arg is the loaded image. If `action` is `nil`, the call has no effect.
130-
public func setOnSuccess(perform action: @escaping (PlatformImage) -> Void) {
131-
self.successBlock = { image, _, _ in
132-
action(image)
133-
}
134-
}
135-
136-
/// Provide the action when image load successes.
137-
/// - Parameters:
138-
/// - 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.
139-
public func setOnSuccess(perform action: @escaping (PlatformImage, SDImageCacheType) -> Void) {
140-
self.successBlock = { image, _, cacheType in
141-
action(image, cacheType)
142-
}
143-
}
144-
145127
/// Provide the action when image load successes.
146128
/// - Parameters:
147129
/// - 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.

SDWebImageSwiftUI/Classes/WebImage.swift

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -238,29 +238,6 @@ extension WebImage {
238238
return self
239239
}
240240

241-
/// Provide the action when image load successes.
242-
/// - Parameters:
243-
/// - action: The action to perform. The first arg is the loaded image. If `action` is `nil`, the call has no effect.
244-
/// - Returns: A view that triggers `action` when this image load successes.
245-
public func onSuccess(perform action: @escaping (PlatformImage) -> Void) -> WebImage {
246-
let action = action
247-
self.imageManager.successBlock = { image, _, _ in
248-
action(image)
249-
}
250-
return self
251-
}
252-
253-
/// Provide the action when image load successes.
254-
/// - Parameters:
255-
/// - 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.
256-
/// - Returns: A view that triggers `action` when this image load successes.
257-
public func onSuccess(perform action: @escaping (PlatformImage, SDImageCacheType) -> Void) -> WebImage {
258-
self.imageManager.successBlock = { image, _, cacheType in
259-
action(image, cacheType)
260-
}
261-
return self
262-
}
263-
264241
/// Provide the action when image load successes.
265242
/// - Parameters:
266243
/// - 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.

0 commit comments

Comments
 (0)