From 923e80372ae71da7a25be2ee914e8c08d41c1383 Mon Sep 17 00:00:00 2001 From: essej Date: Sun, 24 Apr 2022 15:23:49 -0400 Subject: [PATCH] juce: use passed in dir for file open browse in ios --- .../juce_gui_basics/native/juce_ios_FileChooser.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deps/juce/modules/juce_gui_basics/native/juce_ios_FileChooser.mm b/deps/juce/modules/juce_gui_basics/native/juce_ios_FileChooser.mm index c89117a..0220620 100644 --- a/deps/juce/modules/juce_gui_basics/native/juce_ios_FileChooser.mm +++ b/deps/juce/modules/juce_gui_basics/native/juce_ios_FileChooser.mm @@ -87,6 +87,14 @@ public: { controller.reset ([controllerClassInstance initWithDocumentTypes: utTypeArray inMode: UIDocumentPickerModeOpen]); + + if (@available(iOS 13, *)) { + if (owner.startingFile.exists()) { + auto url = [[NSURL alloc] initFileURLWithPath: juceStringToNS (owner.startingFile.getFullPathName())]; + [controller.get() setDirectoryURL:url]; + [url release]; + } + } } FileChooserControllerClass::setOwner (controller.get(), this);