1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Add iOS import osu! files

This commit is contained in:
DTSDAO 2019-07-24 20:49:35 +08:00
parent ae66a7e9e4
commit 136f3b8b6b
2 changed files with 31 additions and 1 deletions

View File

@ -1,15 +1,32 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Threading.Tasks;
using Foundation;
using osu.Framework.iOS;
using osu.Game;
using UIKit;
namespace osu.iOS
{
[Register("AppDelegate")]
public class AppDelegate : GameAppDelegate
{
protected override Framework.Game CreateGame() => new OsuGameIOS();
private OsuGameIOS IOSGame;
protected override Framework.Game CreateGame()
{
//Save OsuGameIOS for Import
IOSGame = new OsuGameIOS();
return IOSGame;
}
public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
{
//Open in Application
Task.Run(() => IOSGame.Import(url.Path));
return true;
}
}
}

View File

@ -40,5 +40,18 @@
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>public.item</string>
<key>LSItemContentTypes</key>
<array>
<string>public.item</string>
</array>
</dict>
</array>
</dict>
</plist>