diff --git a/ios/src/io/anuke/mindustry/IOSLauncher.java b/ios/src/io/anuke/mindustry/IOSLauncher.java index a35fc2c617..7f2998a317 100644 --- a/ios/src/io/anuke/mindustry/IOSLauncher.java +++ b/ios/src/io/anuke/mindustry/IOSLauncher.java @@ -64,6 +64,24 @@ public class IOSLauncher extends IOSApplication.Delegate{ try{ coord.coordinateReadingItem(documentURLs.get(0), NSFileCoordinatorReadingOptions.None, url -> { if(url.startAccessingSecurityScopedResource()){ + try{ + controller.importDocument(url, new NSURL(getDocumentsDirectory() + "/document"), UIDocumentBrowserImportMode.Copy, (result, error) -> { + if(error != null){ + ui.showErrorMessage("Import error.\n" + error.getLocalizedFailureReason() + "\n" + error.getLocalizedDescription()); + }else{ + try{ + cons.get(Core.files.absolute(url.getPath())); + }catch(Throwable t){ + ui.showException(t); + } + } + }); + }catch(Throwable t){ + ui.showException(t); + } + + /* + try{ int[] tread = {0}; @@ -106,7 +124,7 @@ public class IOSLauncher extends IOSApplication.Delegate{ ui.showException(t3); } } - } + }*/ }else{ ui.showErrorMessage("Failed to access file."); }