-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring back iOS application delegates and fix many issues #6453
Changes from 1 commit
f21100d
3134295
3ef7542
0edaede
dfbf4b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ namespace osu.Framework.iOS | |
/// </summary> | ||
public abstract class GameApplicationDelegate : UIApplicationDelegate | ||
{ | ||
internal event Action<string>? DragDrop; | ||
|
||
private const string output_volume = "outputVolume"; | ||
|
||
|
@@ -41,6 +42,15 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary l | |
return true; | ||
} | ||
|
||
public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) | ||
{ | ||
// copied verbatim from SDL: https://github.com/libsdl-org/SDL/blob/d252a8fe126b998bd1b0f4e4cf52312cd11de378/src/video/uikit/SDL_uikitappdelegate.m#L508-L535 | ||
// the hope is that the SDL app delegate class does not have such handling exist there, but Apple does not provide a corresponding notification to make that possible. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there some copy-paste error in this comment? I don't really understand what it's supposed to say. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no error, there are just some iOS terminologies mixed in the comment. Apple provides things called The key point of this comment is that some functionalities that used to exist in |
||
NSUrl? fileUrl = url.FilePathUrl; | ||
DragDrop?.Invoke(fileUrl != null ? fileUrl.Path! : url.AbsoluteString!); | ||
return true; | ||
} | ||
|
||
/// <summary> | ||
/// Creates the <see cref="Game"/> class to launch. | ||
/// </summary> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you subclass
SDLUIKitDelegate
? Seems to be supported by SDL. Maybe we don't want the extra baggage that comes from the SDL implementation?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the hope at first but it was an extremely complicated process. We haven't explored through the concept of "iOS binding projects" before, which is an essential key to expose such types in the C# world. And throughout a brief attempt from my end, it cannot be integrated within the
SDL3-CS
project, it has to be in a separate project, eitherSDL3-CS.iOSBindings
orosu.Framework.iOS.SDLBindings
, depending on what the end goal with the iOS binding project turns out.It will be a multi-day effort with back-and-fourth discussions on where and how should it be implemented and whether it's going to cause issues if it's a separate project (looping back to the concern about the Android project being previously separate), so I ultimately gave up on it on the trust that SDL will not silently add crucial code in
SDLUIKitDelegate
.