Skip to content

Conversation

DimDL
Copy link

@DimDL DimDL commented Oct 1, 2025

Add new legacy_uigraphics_functions rule to encourage the use of modern UIGraphicsImageRenderer instead of legacy UIGraphics{Begin|End}ImageContext.

The modern replacement is safer, cleaner, Retina-aware and more performant.
The legacy API is deprecated

Resolves #6268

@SwiftLintBot
Copy link

SwiftLintBot commented Oct 1, 2025

188 Warnings
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/TestFavicons.swift:52:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/TestFavicons.swift:57:13: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/TestFavicons.swift:58:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/TestFavicons.swift:70:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/TestFavicons.swift:75:13: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/TestFavicons.swift:76:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:35:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:37:23: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:38:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:86:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:90:20: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:91:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:100:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:111:27: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Shared/Extensions/UIImageExtensions.swift:112:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Brave/Extensions/UIViewExtensions.swift:21:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Brave/Extensions/UIViewExtensions.swift:23:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Brave/Extensions/UIViewExtensions.swift:24:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /SharedPackages/UIComponents/Sources/UIComponents/iOS/FadeOutLabel.swift:58:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /SharedPackages/UIComponents/Sources/UIComponents/iOS/FadeOutLabel.swift:68:29: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /SharedPackages/UIComponents/Sources/UIComponents/iOS/FadeOutLabel.swift:69:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/UIViewExtension.swift:81:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/UIViewExtension.swift:84:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/UIViewExtension.swift:85:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGoTests/StringExtensionTests.swift:197:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGoTests/StringExtensionTests.swift:200:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGoTests/StringExtensionTests.swift:201:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/CredentialProvider/Extensions/UIImageExtension.swift:9:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/CredentialProvider/Extensions/UIImageExtension.swift:10:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/CredentialProvider/Extensions/UIImageExtension.swift:13:16: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Downloads/DownloadsPanel.swift:199:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Downloads/DownloadsPanel.swift:226:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Downloads/DownloadsPanel.swift:227:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIView+Screenshot.swift:46:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIView+Screenshot.swift:48:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIView+Screenshot.swift:49:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIImage+Extension.swift:10:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIImage+Extension.swift:13:24: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIImage+Extension.swift:14:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIImage+Extension.swift:23:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIImage+Extension.swift:28:24: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Extensions/UIImage+Extension.swift:29:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /BrowserKit/Sources/SiteImageView/ImageProcessing/LetterImageGenerator.swift:54:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /BrowserKit/Sources/SiteImageView/ImageProcessing/LetterImageGenerator.swift:60:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /BrowserKit/Sources/SiteImageView/ImageProcessing/LetterImageGenerator.swift:61:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /BrowserKit/Sources/ToolbarKit/AddressToolbar/LocationView/LocationView.swift:716:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /BrowserKit/Sources/ToolbarKit/AddressToolbar/LocationView/LocationView.swift:721:24: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /BrowserKit/Sources/ToolbarKit/AddressToolbar/LocationView/LocationView.swift:722:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/StorageTests/DiskImageStoreTests.swift:69:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/StorageTests/DiskImageStoreTests.swift:72:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/StorageTests/DiskImageStoreTests.swift:73:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /focus-ios/BlockzillaPackage/Sources/UIHelpers/FaviIconGenerator.swift:25:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /focus-ios/BlockzillaPackage/Sources/UIHelpers/FaviIconGenerator.swift:27:13: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Firefox: /focus-ios/BlockzillaPackage/Sources/UIHelpers/FaviIconGenerator.swift:31:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/RootTabBar/RootTabBarViewController.swift:355:3: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/RootTabBar/RootTabBarViewController.swift:356:11: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/Features/RootTabBar/RootTabBarViewController.swift:365:10: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/Image.swift:22:3: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/Image.swift:23:11: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/Image.swift:28:10: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/Image.swift:46:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/Image.swift:49:20: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/Image.swift:50:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/UIImage+Color.swift:5:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/UIImage+Color.swift:12:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Kickstarter: /Library/UIImage+Color.swift:13:5: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/Shared/RSImage.swift:70:3: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/Shared/RSImage.swift:73:22: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in NetNewsWire: /Modules/RSCore/Sources/RSCore/Shared/RSImage.swift:74:4: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/LenticularOverlayView.swift:13:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/LenticularOverlayView.swift:23:27: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/LenticularOverlayView.swift:24:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /Modules/Utils/Sources/PocketCastsUtils/Extensions/UI/UIImage+Tint.swift:6:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /Modules/Utils/Sources/PocketCastsUtils/Extensions/UI/UIImage+Tint.swift:23:28: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /Modules/Utils/Sources/PocketCastsUtils/Extensions/UI/UIImage+Tint.swift:24:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /Modules/Utils/Sources/PocketCastsUtils/Extensions/UI/UIImage+Tint.swift:51:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /Modules/Utils/Sources/PocketCastsUtils/Extensions/UI/UIImage+Tint.swift:52:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in PocketCasts: /Modules/Utils/Sources/PocketCastsUtils/Extensions/UI/UIImage+Tint.swift:55:16: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/UI Elements/Sliders/VerticalSliderControl.swift:569:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/UI Elements/Sliders/VerticalSliderControl.swift:578:19: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/UI Elements/Sliders/VerticalSliderControl.swift:579:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/Extensions/UIKit/UIImage+TintColor.swift:17:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/Extensions/UIKit/UIImage+TintColor.swift:29:27: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/Extensions/UIKit/UIImage+TintColor.swift:30:13: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/Extensions/UIKit/UIImage+TintColor.swift:34:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/Extensions/UIKit/UIImage+Gradient.swift:19:13: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/Extensions/UIKit/UIImage+Gradient.swift:40:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/Extensions/UIKit/UIImage+Gradient.swift:46:25: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in VLC: /Sources/Extensions/UIKit/UIImage+Gradient.swift:48:13: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Components/TokenField/TokenSeparatorAttachment.swift:78:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Components/TokenField/TokenSeparatorAttachment.swift:102:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Components/TokenField/TokenSeparatorAttachment.swift:105:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Components/TokenField/TokenTextAttachment.swift:63:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Components/TokenField/TokenTextAttachment.swift:80:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Components/TokenField/TokenTextAttachment.swift:83:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/UserInterface/Calling/CallGridView/RoundedPageIndicator.swift:92:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/UserInterface/Calling/CallGridView/RoundedPageIndicator.swift:109:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/UserInterface/Calling/CallGridView/RoundedPageIndicator.swift:110:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/UserInterface/Components/Views/Mentions/MentionsTextAttachment.swift:80:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/UserInterface/Components/Views/Mentions/MentionsTextAttachment.swift:83:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/UserInterface/Components/Views/Mentions/MentionsTextAttachment.swift:84:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/String+Image.swift:27:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/String+Image.swift:29:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/String+Image.swift:30:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:30:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:32:27: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:33:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:44:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:50:26: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:51:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:58:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:64:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:65:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:139:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:145:21: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/Wire-iOS/Sources/Helpers/UIImage+ImageUtilities.swift:146:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/WireCommonComponents/FilePreviewGenerator/PDFFilePreviewGenerator.swift:32:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/WireCommonComponents/FilePreviewGenerator/PDFFilePreviewGenerator.swift:33:17: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /wire-ios/WireCommonComponents/FilePreviewGenerator/PDFFilePreviewGenerator.swift:56:24: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /WireUI/Sources/WireDesign/Icons/Autogenerated/WireStyleKit.swift:7183:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /WireUI/Sources/WireDesign/Icons/Autogenerated/WireStyleKit.swift:7186:33: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /WireUI/Sources/WireDesign/Icons/Autogenerated/WireStyleKit.swift:7187:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /WireUI/Sources/WireDesign/Icons/Autogenerated/WireStyleKit.swift:7193:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /WireUI/Sources/WireDesign/Icons/Autogenerated/WireStyleKit.swift:7196:30: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /WireUI/Sources/WireDesign/Icons/Autogenerated/WireStyleKit.swift:7197:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ This PR introduced a violation in Wire: /WireUI/Sources/WireDesign/Icons/Autogenerated/WireStyleKit.swift:7203:9: Warning: Prefer using UIGraphicsImageRenderer over legacy functions (legacy_uigraphics_functions)
⚠️ Danger found 188 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 126.
18 Messages
📖 Building this branch resulted in a binary size of 26159.23 KiB vs 26133.02 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.78 s vs 0.81 s on main (3% faster).
📖 Linting Alamofire with this PR took 0.96 s vs 0.97 s on main (1% faster).
📖 Linting Brave with this PR took 6.78 s vs 6.77 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 20.87 s vs 20.87 s on main (0% slower).
📖 Linting Firefox with this PR took 10.78 s vs 10.75 s on main (0% slower).
📖 Linting Kickstarter with this PR took 7.6 s vs 7.57 s on main (0% slower).
📖 Linting Moya with this PR took 0.42 s vs 0.41 s on main (2% slower).
📖 Linting NetNewsWire with this PR took 2.38 s vs 2.34 s on main (1% slower).
📖 Linting Nimble with this PR took 0.66 s vs 0.62 s on main (6% slower).
📖 Linting PocketCasts with this PR took 6.57 s vs 6.59 s on main (0% faster).
📖 Linting Quick with this PR took 0.37 s vs 0.37 s on main (0% slower).
📖 Linting Realm with this PR took 3.3 s vs 3.3 s on main (0% slower).
📖 Linting Sourcery with this PR took 1.83 s vs 1.78 s on main (2% slower).
📖 Linting Swift with this PR took 4.1 s vs 4.09 s on main (0% slower).
📖 Linting VLC with this PR took 1.11 s vs 1.1 s on main (0% slower).
📖 Linting Wire with this PR took 17.13 s vs 17.14 s on main (0% faster).
📖 Linting WordPress with this PR took 11.24 s vs 11.18 s on main (0% slower).

Generated by 🚫 Danger

Copy link
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

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

Thanks for the prompt implementation of your issue!

Please consider my comments ... Have you checked whether the OSS findings reported in the bot comment make sense?

Comment on lines +31 to +33
* Add `legacy_uigraphics_functions` rule to encourage the use of modern
UIGraphicsImageRenderer instead of legacy UIGraphics{Begin|End}ImageContext.
The modern replacement is safer, cleaner, Retina-aware and more performant.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Add `legacy_uigraphics_functions` rule to encourage the use of modern
UIGraphicsImageRenderer instead of legacy UIGraphics{Begin|End}ImageContext.
The modern replacement is safer, cleaner, Retina-aware and more performant.
* Add `legacy_uigraphics_functions` rule to encourage the use of modern
`UIGraphicsImageRenderer `instead of legacy `UIGraphics{Begin|End}ImageContext`.
The modern replacement is safer, cleaner, Retina-aware and more performant.

@@ -0,0 +1,82 @@
import SwiftSyntax

@SwiftSyntaxRule
Copy link
Collaborator

Choose a reason for hiding this comment

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

The rule should be opt-in as you have described in the issue:

Suggested change
@SwiftSyntaxRule
@SwiftSyntaxRule(optIn: true)

kind: .idiomatic,
nonTriggeringExamples: [
Example("""
let renderer = UIGraphicsImageRenderer(size: bounds.size)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tests can be a bit easier, as the rule effectively only checks function names. So the let screenshot = ... part isn't actually necessary.

@SimplyDanny
Copy link
Collaborator

SimplyDanny commented Oct 2, 2025

I wasn't actually aware of LegacyFunctionRuleHelper. Can we make use of it for this rule as well?

Edit: I remove the helper in #6271 so that visitor and rewrite can directly be used.

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.

Rule Request: "Legacy UIGraphics functions"

3 participants