A game framework written with osu! in mind.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add iOS clipboard implementation

+29
+27
osu.Framework.iOS/IOSClipboard.cs
··· 1 + // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2 + // See the LICENCE file in the repository root for full licence text. 3 + 4 + using osu.Framework.Platform; 5 + using UIKit; 6 + 7 + namespace osu.Framework.iOS 8 + { 9 + public class IOSClipboard : Clipboard 10 + { 11 + private readonly IOSGameView gameView; 12 + 13 + internal IOSClipboard(IOSGameView gameView) 14 + { 15 + this.gameView = gameView; 16 + } 17 + 18 + public override string GetText() 19 + { 20 + string text = ""; 21 + gameView.InvokeOnMainThread(() => text = UIPasteboard.General.String); 22 + return text; 23 + } 24 + 25 + public override void SetText(string selectedText) => gameView.InvokeOnMainThread(() => UIPasteboard.General.String = selectedText); 26 + } 27 + }
+2
osu.Framework.iOS/IOSGameHost.cs
··· 89 89 90 90 public override void OpenUrlExternally(string url) => throw new NotImplementedException(); 91 91 92 + public override Clipboard GetClipboard() => new IOSClipboard(gameView); 93 + 92 94 public override IResourceStore<TextureUpload> CreateTextureLoaderStore(IResourceStore<byte[]> underlyingStore) 93 95 => new IOSTextureLoaderStore(underlyingStore); 94 96