juce: use passed in dir for file open browse in ios

This commit is contained in:
essej 2022-04-24 15:23:49 -04:00
parent 7a95ca9c82
commit 923e80372a

View File

@ -87,6 +87,14 @@ public:
{ {
controller.reset ([controllerClassInstance initWithDocumentTypes: utTypeArray controller.reset ([controllerClassInstance initWithDocumentTypes: utTypeArray
inMode: UIDocumentPickerModeOpen]); 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); FileChooserControllerClass::setOwner (controller.get(), this);