Skip to content

Commit

Permalink
Fix iOS file presentation code not scheduled to main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Jan 30, 2025
1 parent 37e1475 commit 2bcd26f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions osu.Framework.iOS/IOSGameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ protected override void SetupConfig(IDictionary<FrameworkSetting, object> defaul

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)
{
Expand Down

0 comments on commit 2bcd26f

Please sign in to comment.