You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could have a legacy_uigraphics_functions, which can already be defined as a custom rule:
custom_rules:
legacy_uigraphics_functions:
included: ".*\\.swift"
name: "Legacy UIGraphics functions"
regex: "(UIGraphicsBeginImageContextWithOptions|UIGraphicsBeginImageContext|UIGraphicsGetImageFromCurrentImageContext|UIGraphicsEndImageContext)\\s*\\("
message: "This UIGraphics method is deprecated. Use UIGraphicsImageRenderer and related APIs instead."
severity: warning
These 4 methods are already marked API_TO_BE_DEPRECATED in UIKit Headers.
This new rule would match existing SwiftLint rule such as legacy_cggeometry_functions and legacy_nsgeometry_functions
configurable: no
opt-in: yes, to match existing rules legacy_*_functions ? The replacement API (UIGraphicsImageRenderer) exists since iOS 10.
FYI, the release notes for the version that released this calls it legacy_uigraphics_functions, but the rule as implemented in #6269 is called legacy_uigraphics_function (no trailing s).
FYI, the release notes for the version that released this calls it legacy_uigraphics_functions, but the rule as implemented in #6269 is called legacy_uigraphics_function (no trailing s).
Thanks for the note, @ZevEisenberg! I've updated the name in the release notes.
Activity
ZevEisenberg commentedon May 27, 2026
FYI, the release notes for the version that released this calls it
legacy_uigraphics_functions, but the rule as implemented in #6269 is calledlegacy_uigraphics_function(no trailing s).SimplyDanny commentedon May 27, 2026
Thanks for the note, @ZevEisenberg! I've updated the name in the release notes.
ZevEisenberg commentedon May 27, 2026
Ditto the changelog entry in that PR
SimplyDanny commentedon May 27, 2026
813c7d3