Cannot customize filename for UIActivityItemSource shared to iCloud Drive

Originator:an00na
Number:rdar://33558778 Date Originated:July 26 2017, 10:19 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:11 beta 4
Classification:UI/Usability Reproducible:Always
 
Area:
UIKit

Summary:
When using UIActivityViewController to share a UIActivityItemSource vending UIImage to iCloud Drive the subject returned from -[UIActivityItemSource activityViewController:subjectForActivityType:] is ignored by iCloud Drive and it always uses "Image" on iOS 10 and "Image.png" on iOS 11 as the filename.

It causes 2 issues:
1. On iOS 10 image files without image file extension cannot be identified, displayed or opened as images in iCloud Drive.
2. Repeated saving images using the same filename triggers "filename exists" alert in iCloud Drive.

Steps to Reproduce:
1. Launch sample app.
2. Tap share button.
3. Select Add to iCloud Drive.

Expected Results:
Filename uses the subject returned from -[UIActivityItemSource activityViewController:subjectForActivityType:] so that it can be customized.

Observed Results:
The subject returned from -[UIActivityItemSource activityViewController:subjectForActivityType:] is ignored and filename is always the same.

Code: https://mega.nz/#!Mfp1haSA!aRzel_FgVeG6FQk7Mu8vtLL6t2u83oWYMEI3gldfNWc

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!