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
It would be happy when Image that initialized with string replaced with initializer with asset symbols.
Why should this rule be added? Share links to existing discussion about what
the community thinks about this.
UIKit.UIImage(named:) and SwiftUI.Image(_:) contain the risk of bugs due to typos.
Since Xcode 15, Xcode generates codes for images in the Asset Catalog and it can avoid typos. (ref)
Provide several examples of what would and wouldn't trigger violations.
// UIKit
UIImage(resource:.someImage)UIImage(systemName:"trash") // using SF Symbols
// SwiftUI
Image(.someImage)Image(systemName:"trash") // using SF Symbols
Should the rule be configurable, if so what parameters should be configurable?
Currently no.
Should the rule be opt-in or enabled by default? Why?
See README.md for guidelines on when to mark a rule as opt-in.
Enabled by default on Swift 5.9+.
Asset symbol generation is enabled by default in Xcode, and it needs editing the build setting to disable it.
The text was updated successfully, but these errors were encountered:
New Issue Checklist
New Rule Request
It would be happy when Image that initialized with string replaced with initializer with asset symbols.
UIKit.UIImage(named:)
andSwiftUI.Image(_:)
contain the risk of bugs due to typos.Since Xcode 15, Xcode generates codes for images in the Asset Catalog and it can avoid typos. (ref)
Would trigger:
Would not trigger:
Currently no.
Enabled by default on Swift 5.9+.
Asset symbol generation is enabled by default in Xcode, and it needs editing the build setting to disable it.
The text was updated successfully, but these errors were encountered: