dragInteraction(_:prefersFullSizePreviewsFor:) has no effect

Originator:an00na
Number:rdar://33141853 Date Originated:July 5 2017, 3:40 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:11.0 beta 2
Classification:Other Bug Reproducible:Always
 
Area:
UIKit

Summary:
My dragInteraction(_:prefersFullSizePreviewsFor:) returns true but the preview is still scaled down.

Steps to Reproduce:
1. Launch sample app.
2. Try dragging.

Expected Results:
Preview isn't scaled down.

Observed Results:
Preview is scaled down.

Code: https://mega.nz/#!sGQgTDiR!JfbpdGYFM26fB6xIebdotCUZt-wIF8AHe9DY-2fC2hI

Comments

Me July 7 2017, 3:38 PM

Thanks. But we shouldn't rely on WWDC videos to gain such knowledges. Can you update the API doc to explain it? Otherwise I believe many devs would think this API is broken.

Apple Developer Relations July 7 2017, 12:24 PM

The value you return from dragInteraction(_:prefersFullSizePreviewsFor:) is used as a hint, not an absolute requirement. We reserve the right to scale down the preview if we think it covers too much of the screen to make dragging usable.

In this case the preview covers more than half of the area of the screen, so we scale it smaller. Try a preview that is slightly smaller and you’ll see that it is not scaled.

Please see the WWDC 2017 session “Mastering Drag and Drop” for more details: https://developer.apple.com/videos/play/wwdc2017/213/


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!