Skip to content

Commit 7774e64

Browse files
authored
Merge pull request #6517 from frenzibyte/ios-fix-threading-issues
Fix iOS file presentation code not scheduled to main thread
2 parents 37e1475 + 2bcd26f commit 7774e64

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

osu.Framework.iOS/IOSGameHost.cs

+10-2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,17 @@ protected override void SetupConfig(IDictionary<FrameworkSetting, object> defaul
5656

5757
public override Storage GetStorage(string path) => new IOSStorage(path, this);
5858

59-
public override bool OpenFileExternally(string filename) => presenter.OpenFile(filename);
59+
public override bool OpenFileExternally(string filename)
60+
{
61+
UIApplication.SharedApplication.InvokeOnMainThread(() => presenter.OpenFile(filename));
62+
return true;
63+
}
6064

61-
public override bool PresentFileExternally(string filename) => presenter.PresentFile(filename);
65+
public override bool PresentFileExternally(string filename)
66+
{
67+
UIApplication.SharedApplication.InvokeOnMainThread(() => presenter.PresentFile(filename));
68+
return true;
69+
}
6270

6371
public override void OpenUrlExternally(string url)
6472
{

0 commit comments

Comments
 (0)