-[NSItemProvider hasRepresentationConformingToTypeIdentifier:fileOptions:NSItemProviderFileOptionOpenInPlace] returns NO even though the the item can be opened in place
| Originator: | lextar | ||
| Number: | rdar://32812030 | Date Originated: | June 16 2017, 12:42 |
| Status: | Open | Resolved: | |
| Product: | iOS+SDK | Product Version: | 11.0 (15A5278f) |
| Classification: | Other Bug | Reproducible: | Always |
Area: Something not on this list Summary: When you drag a file from an app that registers a file-backed representation with an NSItemProvider and then try to drag it over a view that can accept such drop, -[NSItemProvider hasRepresentationConformingToTypeIdentifier:fileOptions:NSItemProviderFileOptionOpenInPlace] returns NO, but loadInPlaceFileRepresentationForTypeIdentifier:completionHandler: can open the file in-place anyway. Steps to Reproduce: 1. Run the attached sample project on an iPad with iOS 11 beta 1 2. Drag a file from iCloud Drive in the Files App onto the main view of the sample app Expected Results: [item.itemProvider hasRepresentationConformingToTypeIdentifier:uti fileOptions:NSItemProviderFileOptionOpenInPlace] should return YES, so this should be logged to the console: hasRepresentationConformingToTypeIdentifier: public.data in-place: 1, copy: 1 Observed Results: Instead, the following is logged to the console: hasRepresentationConformingToTypeIdentifier: public.data in-place: 0, copy: 1 loadInPlaceFileRepresentationForTypeIdentifier: url=file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/test.txt, inPlace=1, error=(null) This means that [item.itemProvider hasRepresentationConformingToTypeIdentifier:uti fileOptions:NSItemProviderFileOptionOpenInPlace] returns NO, but later in -dropInteraction:performDrop: the file can then be successfully opened in-place. Version: 11.0 (15A5278f) Notes: For this bug report, I dragged a file from the Files app to make it easier to reproduce the problem. But, the same happens when I drag the file from another app that registers a file-backed representation using -[registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:] with NSItemProviderFileOptionOpenInPlace and NSItemProviderRepresentationVisibilityAll. Configuration: iPad Pro 10.5" Wifi 256 GB
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!