22 questions
2
votes
0
answers
141
views
SwiftUI Transferable: support drag to Finder on macOS
I am trying to support dragging out a 'file' object from my app into Finder, on macOS. I have my object conform to Transferable and the files are saved on disk locally, so. I just want to pass it the ...
0
votes
1
answer
62
views
How to properly register a failable load handler for an NSItemProvider [closed]
When registering a file representation to NSItemProvider for a SwiftUI view and calling the completionHandler of the registerFileRepresentation method with a nil argument for the URL, the next time an ...
-2
votes
1
answer
36
views
How to check same file using NSItemProvider in iOS?
When I get some images of Photos in iPhone device using NSItemProvider by PHPickerViewController, I want to know how to check same file(image) with picked photos.
Because I use NSItemProvider, the ...
2
votes
0
answers
160
views
SwiftUI receiving NSFilePromiseReceiver via NSItemProvider
I have a SwiftUI list that can receive dropped images. I want it to support file promises to get full-resolution images from the Photos app (on macOS, though presumably similar on iOS).
Here's a ...
1
vote
0
answers
796
views
How do I maintain transparency when loading WebP format images on iOS?
I have a function to import images from an array of NSItemProvider (passed from a PHPickerViewController) and I need to maintain transparency in the images. Any images in PNG format are correctly ...
3
votes
2
answers
1k
views
NSItemProvider[URL] - how to COPY with drag&Drop instead of MOVE?
I have implemented function that returns NSItemProvider
func dragOutsideWnd(url: URL?) -> NSItemProvider {
if let url = url {
TheApp.appDelegate.hideMainWnd()
let ...
2
votes
0
answers
482
views
Create NSItemProvider from NSImage
Question:
How to create NSItemProvider from NSImage? The image is not being shown in LPLinkView
Is there any other alternate way for creating an NSItemProvider from an image on macOS?
My failed ...
1
vote
2
answers
1k
views
Getting the size of a media item given a NSItemProvider?
I'm using a PHPickerViewController to allow the user to select a media item from their library. And the specific case of interest is when they select a video.
I get a callback on the ...
0
votes
1
answer
209
views
Custom Data Not Working with itemProvider for Drag/Drop Collection View Functionality - Swift
I have a collection view that displays data arranged in a custom data model (struct) called "claimData."
claimData declaration:
struct claimData {
var image = UIImage()
var ...
3
votes
0
answers
216
views
NSItemProvider has no registeredTypeIdentifiers during drop in SwiftUI MacOS app
Trivial example of a drop target. Running on MacOS. When you drag text content from another app (eg Notes), it is successfully targeted (ie box turns green) but no types are exposed for the actual ...
0
votes
0
answers
596
views
how to use loadItemForTypeIdentifier to load an image
I have the following function which loads an image using the new PHPickerViewController:
- (void) picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results
{
...