Skip to content
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 keyboard shortcuts support when using UIKit for Mac (Project Catalyst) #305

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

revolter
Copy link
Contributor

Fixes #297.

@NSExceptional
Copy link
Collaborator

Can you explain your changes and your approach? I'm wary of accepting something that uses the preprocessor to change the superclass of one of our classes

@revolter
Copy link
Contributor Author

Well, I know it's a bit hacky, but I tried to fix it with minimal changes. I forgot to add usage sample code though. You have to overwrite the keyCommands method in your AppDelegate and return [[FLEXManager sharedManager] getKeyCommands].

The thing is that the only way to make it work is to return actual instances of UIKeyCommand.

@NSExceptional
Copy link
Collaborator

Random question: what does FLEX even look like in a Catalyst app?

@revolter
Copy link
Contributor Author

Well, we don't develop the Mac app anymore, so I can't check it out, and I also don't remember.

But, at least in our case, since the Mac app was a window with a size (or at least an aspect ratio) of an iPad, both the app and FLEX looked like on a regular iPad.

@NSExceptional
Copy link
Collaborator

Well since it's not a priority right now I'm gonna close this :P If you plan on deleting the associated branch, let me know so I can fork it; I don't want your work to go to waste if I do eventually get around to this

@revolter
Copy link
Contributor Author

revolter commented Apr 27, 2022

Well since it's not a priority right now I'm gonna close this :P

Sooo, I agreed with you, but then I thought that I could add Catalyst apps to the example project(s), so that contributors have the ability to test PRs like this one directly.

But after downloading the repo, I noticed that both the CocoaPods and the SPM example projects have a catalyst app added:

image

Knowing this, I'll try to rebase the branch.

@revolter
Copy link
Contributor Author

Actually, I think that I can run the app on my Mac because I have it's M1.

@revolter
Copy link
Contributor Author

Apparently, it works even if you don't override the keyCommands property getter, so the changes will be minimal. I don't know if anything changed since 2019, or if I was dumber and didn't notice this.

@revolter
Copy link
Contributor Author

@NSExceptional, this is now ready for review

@NSExceptional
Copy link
Collaborator

Did you rebase it? Still says there are conflicts

@revolter
Copy link
Contributor Author

Could you try reopening the PR? Because I did force push it:

~/Development/GitHub/revolter/FLEX> git push --porcelain --progress --force-with-lease --tags origin refs/heads/feature/catalyst-shortcuts:refs/heads/feature/catalyst-shortcuts
Delta compression using up to 10 threads
Total 68 (delta 52), reused 0 (delta 0), pack-reused 0
To github.com:revolter/FLEX.git
+ refs/heads/feature/catalyst-shortcuts:refs/heads/feature/catalyst-shortcuts f7659a8...1c91354 (forced update)
* refs/tags/4.7.0:refs/tags/4.7.0 [new tag]
Done

@revolter
Copy link
Contributor Author

I had to rebase it yet again, which caused me to notice that you used file:///Users/tanner/Repos/Reflex in 8f99563, which will obviously not work for others, so I overwrite it with 5efec8c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyboard shortcuts don't work when using UIKit for Mac (Project Catalyst)
2 participants