Fixed sharing crash
This commit is contained in:
@@ -11,6 +11,7 @@ import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.game.Saves.*;
|
||||
import io.anuke.mindustry.io.*;
|
||||
import io.anuke.mindustry.ui.*;
|
||||
import org.robovm.apple.dispatch.*;
|
||||
import org.robovm.apple.foundation.*;
|
||||
import org.robovm.apple.uikit.*;
|
||||
import org.robovm.objc.block.*;
|
||||
@@ -88,9 +89,10 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
||||
}
|
||||
|
||||
cont.setDelegate(new ChooserDelegate());
|
||||
UIApplication.getSharedApplication().getKeyWindow().getRootViewController().presentViewController(cont, true, () -> {
|
||||
|
||||
});
|
||||
// DispatchQueue.getMainQueue().sync(() -> {
|
||||
UIApplication.getSharedApplication().getKeyWindow().getRootViewController().presentViewController(cont, true, () -> {});
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,10 +103,12 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
||||
|
||||
NSURL url = new NSURL(to.file());
|
||||
UIActivityViewController p = new UIActivityViewController(Collections.singletonList(url), null);
|
||||
p.getPopoverPresentationController().setSourceView(UIApplication.getSharedApplication().getKeyWindow().getRootViewController().getView());
|
||||
//p.getPopoverPresentationController().setSourceView(UIApplication.getSharedApplication().getKeyWindow().getRootViewController().getView());
|
||||
|
||||
//DispatchQueue.getMainQueue().sync(() -> {
|
||||
UIApplication.getSharedApplication().getKeyWindow().getRootViewController()
|
||||
.presentViewController(p, true, () -> io.anuke.arc.util.Log.info("Success! Presented {0}", to));
|
||||
.presentViewController(p, true, () -> Log.info("Success! Presented {0}", to));
|
||||
//});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user