Closed drjasonharrison closed 7 years ago
Hi, please try to change swift patterns from @"(.+?)"
to "(.+?)"
.
Yes! that fixes the problem with the false positives! Thank you! Can you please explain how the @ symbol is being used in the regular expression? As a the Objective-C escape for NSString literals, or as a PERL array?
The regular expression is used to match string in source code. In Objective-C, string constants start with @
, like NSString *str = @"background";
. But in swift, string constants don't need the @
symbol.
We have image assets that are referenced in code as
Asset.imageName.image
. The list of image assets is generated using SwiftGen using the following command as a build phase:If LSUnusedResources had access to Images.swift it would have the mapping between image filename and code Asset.imageName:
And then LSUnusedResources could search the source code for "Asset." and then for one of image names.