-
Notifications
You must be signed in to change notification settings - Fork 62
Modernized to modern Swifty style, features, and Swift version bump #45
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
Open
mredig
wants to merge
39
commits into
tmandry:main
Choose a base branch
from
mredig:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locate in UIElement namespace and make deprecated typealiases available
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of it was opinionated (like moving the constants organization so each type has its own file and nesting the constant types)
Some was modernizing the features (typed throws)
Some was restructuring away from enums where values aren't inherently limited in scope (as the underlying types are stringly typed and can apparently have new values added via the system), while also removing the need for string variant methods.
Additionally, it was all done with drop in compatibility in mind... (nested types now have a top level typealias marked as deprecated to keep the source of truth properly scoped, but not break existing code and enums are now structs with static properties matching their old cases.) The only thing that I can think of that would require any code editing would be if someone required exhausting switching over an enum that got changed to a struct, but that shouldn't be common, nor would I expect it would be a good idea with the possibility that values could exist outside those scopes.
Also, it should generally be compatible with Swift 6.1 (current as of this writing), but
kAXTrustedCheckOptionPrompt
causes compilation errors due to concurrency safety (Reference to var 'kAXTrustedCheckOptionPrompt' is not concurrency-safe because it involves shared mutable state
). I cannot figure out how to either tell the compiler to ignore it or fix the issue. I created another PR (#46) where I replace it with a raw, inline string, but I don't know if that would be a good idea, so I'm just leaving this PR as Swift 5.10 since that has all the necessary modern features for my updates, but you could also choose the other one with the later Swift version (If you like my changes).