···11+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
22+// See the LICENCE file in the repository root for full licence text.
33+44+using osu.Framework.Platform;
55+using UIKit;
66+77+namespace osu.Framework.iOS
88+{
99+ public class IOSClipboard : Clipboard
1010+ {
1111+ private readonly IOSGameView gameView;
1212+1313+ internal IOSClipboard(IOSGameView gameView)
1414+ {
1515+ this.gameView = gameView;
1616+ }
1717+1818+ public override string GetText()
1919+ {
2020+ string text = "";
2121+ gameView.InvokeOnMainThread(() => text = UIPasteboard.General.String);
2222+ return text;
2323+ }
2424+2525+ public override void SetText(string selectedText) => gameView.InvokeOnMainThread(() => UIPasteboard.General.String = selectedText);
2626+ }
2727+}
+2
osu.Framework.iOS/IOSGameHost.cs
···89899090 public override void OpenUrlExternally(string url) => throw new NotImplementedException();
91919292+ public override Clipboard GetClipboard() => new IOSClipboard(gameView);
9393+9294 public override IResourceStore<TextureUpload> CreateTextureLoaderStore(IResourceStore<byte[]> underlyingStore)
9395 => new IOSTextureLoaderStore(underlyingStore);
9496