Skip to content
Discussion options

You must be logged in to vote

There is an image object in the onSuccess callback, maybe you can try to store that and create an NSItemProvider. Some sample snippets:

var image: KFCrossPlatformImage?

struct ContentView : View {
  KFImage(url)
    .onSuccess { r in
      image = r.image
    }
    .onDrag({
      if let i = image {
        return .init(object: i)
      } else {
        return .init(contentsOf: url) ?? .init()
      }
    })
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@axiel7
Comment options

Answer selected by axiel7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants