-
Notifications
You must be signed in to change notification settings - Fork 423
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
Add support for presenting/opening files on iOS #6448
Conversation
|
||
private UIWindow? window; | ||
|
||
public bool OpenFile(string filename, UIWindow window) |
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.
Can't we pass this in the ctor rather than having it weird nullable and passed in every method?
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.
I couldn't find a good place wherein the IOSWindow
is initialised other than doing it directly at GameHost.CreateWindow()
so I figured I might as well just do it this way.
Maybe it would be good to have an OnInitialised
method exposed from GameHost
that's called after everything is set up, so that other components provided by derived game host classes can be initialised at that point with all resources available.
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.
or just on first usage. point is, the nullable part is in a weird place. we'd never pass a window in on each method in a class just because it needs to arrive once somewhere
osu.Framework.iOS/IOSGameHost.cs
Outdated
private IOSFilePresenter? backingPresenter; | ||
private IOSFilePresenter presenter => backingPresenter ??= new IOSFilePresenter(iosWindow.UIWindow); |
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.
i'd probably prefer using Lazy<>
instead of backingXXX
just to conform to existing standards.
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.
Don't intend to drag this but I made it a lazy and then felt I could just take a different much simpler approach instead. 7c7529d
Allows exporting files in the game. Preview:
CleanShot.2024-12-09.at.07.43.23.mp4