Join GitHub today
Rule Request: Discouraged Object Literal (Opt-In) #1987
SwiftLint provides a rule to enforce the use of literals over
Some of the reasons not to use literals:
Below, the same image literal example with four different Xcode templates.
As shown above, the icon is hard to visualize when using dark background color and there's no information about the asset used (which asset is being used?, what's its name?).
A custom rule can be used as workaround to disable image literals while the new opt-in rule isn't implemented and merged into master.
A similar custom rule can be easily implemented for color literals.