From 2bcd26fb17ccc1358c2932ab9ded9b69a856adb4 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Thu, 30 Jan 2025 08:39:27 -0500 Subject: [PATCH] Fix iOS file presentation code not scheduled to main thread --- osu.Framework.iOS/IOSGameHost.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Framework.iOS/IOSGameHost.cs b/osu.Framework.iOS/IOSGameHost.cs index 6a348e95d..f81c25b4f 100644 --- a/osu.Framework.iOS/IOSGameHost.cs +++ b/osu.Framework.iOS/IOSGameHost.cs @@ -56,9 +56,17 @@ namespace osu.Framework.iOS public override Storage GetStorage(string path) => new IOSStorage(path, this); - public override bool OpenFileExternally(string filename) => presenter.OpenFile(filename); + public override bool OpenFileExternally(string filename) + { + UIApplication.SharedApplication.InvokeOnMainThread(() => presenter.OpenFile(filename)); + return true; + } - public override bool PresentFileExternally(string filename) => presenter.PresentFile(filename); + public override bool PresentFileExternally(string filename) + { + UIApplication.SharedApplication.InvokeOnMainThread(() => presenter.PresentFile(filename)); + return true; + } public override void OpenUrlExternally(string url) {