Skip to content

Conversation

@varada2906
Copy link

Fixes iOS 15+ build error caused by deprecated kUTTypeGIF usage.
Replaced deprecated kUTTypeGIF with UTTypeGIF from UniformTypeIdentifiers, resolving the compiler error when warnings are treated as errors.
Fixes #180162

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@google-cla
Copy link

google-cla bot commented Jan 26, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a build error on iOS 15+ caused by the use of the deprecated kUTTypeGIF constant. The fix correctly replaces it with UTTypeGIF.identifier from the UniformTypeIdentifiers framework for newer iOS versions. I have a suggestion to improve the implementation by using the modern API starting from iOS 14, where it became available, and to clean up some minor formatting issues that deviate from standard Objective-C style.

Comment on lines 122 to 129
if (@available(iOS 15.0, *)) {
options[(NSString *)kCGImageSourceTypeIdentifierHint] =
(NSString *)UTTypeGIF.identifier;
} else {
options[(NSString *)kCGImageSourceTypeIdentifierHint] =
(NSString *)kUTTypeGIF;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this correctly fixes the deprecation warning on iOS 15, the UniformTypeIdentifiers API is available starting from iOS 14. It's better to adopt the new API from iOS 14 onwards. Also, the cast (NSString *) on UTTypeGIF.identifier is redundant as it already returns an NSString *. Finally, the indentation in this block is inconsistent and an extra blank line has been added, both of which should be fixed to improve readability.

  if (@available(iOS 14.0, *)) {
    options[(NSString *)kCGImageSourceTypeIdentifierHint] = UTTypeGIF.identifier;
  } else {
    options[(NSString *)kCGImageSourceTypeIdentifierHint] = (NSString *)kUTTypeGIF;
  }
References
  1. Code should follow the relevant style guides and use the correct auto-formatter for each language. The indentation in the added code block is inconsistent and an extra blank line was added. (link)

@varada2906
Copy link
Author

This PR only updates a deprecated iOS constant.
There is no logic or behavior change, so tests are not required.
Requesting test exemption.

@stuartmorgan-g
Copy link
Collaborator

In the future, please follow the steps in the PR template instead of deleting them all.

Closing since there is already a PR for this issue that follows our process (#10848).

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.

2 participants