-
Notifications
You must be signed in to change notification settings - Fork 121
kUTType was deprecated in iOS15, use UTType instead #8093
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
Conversation
You can test the changes from this Pull Request by:
|
jaclync
left a comment
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.
Thanks for fixing the warnings in Yosemite tests! I think we can directly compare and use the identifier of any UTType as a string, left some non-blocking suggestions
| let gifTypeIdentifier = UTType.gif.identifier as CFString | ||
| if UTTypeEqual(resource.uniformTypeIdentifier as CFString, gifTypeIdentifier) { |
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.
nit: I think comparing the identifier strings directly should be fine?
| let gifTypeIdentifier = UTType.gif.identifier as CFString | |
| if UTTypeEqual(resource.uniformTypeIdentifier as CFString, gifTypeIdentifier) { | |
| if resource.uniformTypeIdentifier == UTType.gif.identifier { |
| let gifTypeIdentifier = UTType.gif.identifier as CFString | ||
| guard UTTypeEqual(resource.uniformTypeIdentifier as CFString, gifTypeIdentifier) else { |
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.
nit: similar to above, I think direct string comparison is fine?
| let gifTypeIdentifier = UTType.gif.identifier as CFString | |
| guard UTTypeEqual(resource.uniformTypeIdentifier as CFString, gifTypeIdentifier) else { | |
| guard resource.uniformTypeIdentifier == UTType.gif.identifier else { |
Context
From #1767 :
Description
By updating the minimum release version to iOS 15 recently, we've seen some deprecation warnings. This PR fixes the case for uses of
kUTTypeJPEG,kUTTypePNG, andkUTTypeGIF.This PR does not deal with cases for
UTTypeEqual, as it would seems the deprecation message is meant for Objective-C code?Changes
When returning or comparing different file extensions or file types, we change from using
kUUType*, toUTType.*instead.Testing instructions
I'm not 100% sure if I'm handling all test scenarios here, happy to get further feedback about it, but it should be good with the following: