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

Fix deprecated warnings for macOS #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

karelbilek
Copy link
Contributor

@karelbilek karelbilek commented Feb 19, 2024

macOS has a new framework UniformTypeIdentifiers that needs to be used for this.

Note that the behavior is not exactly the same - if you add "jpg", it will find a UTType that has "jpg" extension and will use that instead of creating a new type; so it will match both "jpg" and "jpeg".

I think it is acceptable (and, probably, even better).

@karelbilek
Copy link
Contributor Author

It's the correct fix of #73 (#73 doesn't actually work).

I haven't done any Obj-C in a long time, I hope it's all correct :P

macOS has a new framework UniformTypeIdentifiers that needs to be used for this.

Note that the behavior is not exactly the same - if you add "jpg", it will find
a UTType that has "jpg" extension and will use that instead of creating a new type;
so it will match both "jpg" and "jpeg".

I think it is acceptable (and, probably, even better).
@sqweek
Copy link
Owner

sqweek commented Feb 26, 2024

I like the sound of it, my only reservation based on the docs is this:

  • macOS 10.6 release date: 28 August 2009
  • macOS 11.0 release date: 12 November 2020

ie. adopting UTType would drop support for 11 years worth of operating systems. Of course we can stay on the deprecated API forever, but suddenly requiring everyone to be within 4 years of bleeding-edge seems a bit too harsh a jump.

Hmm, although this is a little bit exaggerated because 11.0 does support older machines, even some laptops back to 2013. Within 10 years of bleeding-edge seems like an OK cutoff... let me sleep on it

@karelbilek
Copy link
Contributor Author

karelbilek commented Feb 26, 2024 via email

@karelbilek
Copy link
Contributor Author

karelbilek commented Feb 26, 2024 via email

@sqweek
Copy link
Owner

sqweek commented Feb 26, 2024

Interesting read. I'm not in a rush to mandate a 6-month old go version either.

go 1.10 is only 6 years old and supported macOS 10.8 (it was the last go version with official support]).

@karelbilek
Copy link
Contributor Author

karelbilek commented Feb 26, 2024 via email

@anacrolix
Copy link

The PR above fixes it for me. I would recommend just to steam ahead, Apple push updates pretty hard.

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

Successfully merging this pull request may close these issues.

None yet

3 participants