4

Is it possible to implement the look and feel of UIDocumentMenuViewController (deprecated in iOS 11) in iOS 11? The closest I found in iOS 11 is UIDocumentPickerViewController but this doesn't allow me to show up a menu of document providers, instead it modally displays a full screen of the most recently used document provider.

If there are no identical alternatives to UIDocumentMenuViewController, is there at least a way to force UIDocumentPickerViewController to go straight to "Locations" vs showing the most recently used document provider?

Desired result: enter image description here

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user1210182
  • 595
  • 5
  • 11
  • `UIDocumenPickerViewController` in iOS 11 eliminated the need for `UIDocumentMenuViewController`. The user can select a location from the picker view so the menu isn't as useful as it was in iOS 10. – rmaddy Jan 10 '18 at 17:24
  • To my knowledge isn't possible. Apple seems to be pushing the new UI offered by `UIDocumenPickerViewController`. – mattsven Jan 11 '18 at 03:17
  • 1
    Thanks @rmaddy. Any idea if one can get UIDocumentPickerViewController to go straight to the "Browse" tab vs. going to the "Recents" tab? – user1210182 Jan 11 '18 at 16:27
  • Thanks @mattsven. Any idea if iterating through document providers and creating a custom document picker or perhaps customizing the one provided by Apple is feasible? – user1210182 Jan 11 '18 at 16:28
  • Likely not. If you could, it would be a security vulnerability - a developer could query the user's device and get a list of all applications (document providers) installed. – mattsven Jan 11 '18 at 23:00
  • 1
    Thanks @mattsven. This makes perfect sense, but wanted to make sure I tried everything before marking this as unfeasible and your feedback really helps in confirming my assumptions. I appreciate it. – user1210182 Jan 12 '18 at 15:42

1 Answers1

0

you can use UIAlertController with UIAlertControllerStyle.ActionSheet.I have Xamarin.ios code.

var okCancelAlertController = UIAlertController.Create("", "Choose", 
UIAlertControllerStyle.ActionSheet);
//Add Actions
okCancelAlertController.AddAction(UIAlertAction.Create("iCloud", UIAlertActionStyle.Default, (s) => { }));
okCancelAlertController.AddAction(UIAlertAction.Create("Photos", UIAlertActionStyle.Default, (s) => { }));
okCancelAlertController.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, (s) => { }));
UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(okCancelAlertController, true, null);
DSK
  • 91
  • 1
  • 1
  • 5