@@ -54,7 +54,8 @@ extension KingfisherWrapper where Base: NSButton {
54
54
placeholder: KFCrossPlatformImage ? = nil ,
55
55
options: KingfisherOptionsInfo ? = nil ,
56
56
progressBlock: DownloadProgressBlock ? = nil ,
57
- completionHandler: ( @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil ) -> DownloadTask ?
57
+ completionHandler: ( @MainActor @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil
58
+ ) -> DownloadTask ?
58
59
{
59
60
let options = KingfisherParsedOptionsInfo ( KingfisherManager . shared. defaultOptions + ( options ?? . empty) )
60
61
return setImage (
@@ -87,7 +88,8 @@ extension KingfisherWrapper where Base: NSButton {
87
88
placeholder: KFCrossPlatformImage ? = nil ,
88
89
options: KingfisherOptionsInfo ? = nil ,
89
90
progressBlock: DownloadProgressBlock ? = nil ,
90
- completionHandler: ( @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil ) -> DownloadTask ?
91
+ completionHandler: ( @MainActor @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil
92
+ ) -> DownloadTask ?
91
93
{
92
94
return setImage (
93
95
with: resource? . convertToSource ( ) ,
@@ -102,7 +104,8 @@ extension KingfisherWrapper where Base: NSButton {
102
104
placeholder: KFCrossPlatformImage ? = nil ,
103
105
parsedOptions: KingfisherParsedOptionsInfo ,
104
106
progressBlock: DownloadProgressBlock ? = nil ,
105
- completionHandler: ( @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil ) -> DownloadTask ?
107
+ completionHandler: ( @MainActor @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil
108
+ ) -> DownloadTask ?
106
109
{
107
110
var mutatingSelf = self
108
111
guard let source = source else {
@@ -185,7 +188,8 @@ extension KingfisherWrapper where Base: NSButton {
185
188
placeholder: KFCrossPlatformImage ? = nil ,
186
189
options: KingfisherOptionsInfo ? = nil ,
187
190
progressBlock: DownloadProgressBlock ? = nil ,
188
- completionHandler: ( @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil ) -> DownloadTask ?
191
+ completionHandler: ( @MainActor @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil
192
+ ) -> DownloadTask ?
189
193
{
190
194
let options = KingfisherParsedOptionsInfo ( KingfisherManager . shared. defaultOptions + ( options ?? . empty) )
191
195
return setAlternateImage (
@@ -218,7 +222,8 @@ extension KingfisherWrapper where Base: NSButton {
218
222
placeholder: KFCrossPlatformImage ? = nil ,
219
223
options: KingfisherOptionsInfo ? = nil ,
220
224
progressBlock: DownloadProgressBlock ? = nil ,
221
- completionHandler: ( @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil ) -> DownloadTask ?
225
+ completionHandler: ( @MainActor @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil
226
+ ) -> DownloadTask ?
222
227
{
223
228
return setAlternateImage (
224
229
with: resource? . convertToSource ( ) ,
@@ -233,7 +238,8 @@ extension KingfisherWrapper where Base: NSButton {
233
238
placeholder: KFCrossPlatformImage ? = nil ,
234
239
parsedOptions: KingfisherParsedOptionsInfo ,
235
240
progressBlock: DownloadProgressBlock ? = nil ,
236
- completionHandler: ( @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil ) -> DownloadTask ?
241
+ completionHandler: ( @MainActor @Sendable ( Result < RetrieveImageResult , KingfisherError > ) -> Void ) ? = nil
242
+ ) -> DownloadTask ?
237
243
{
238
244
var mutatingSelf = self
239
245
guard let source = source else {
0 commit comments