tinymind / lsunusedresources Goto Github PK
View Code? Open in Web Editor NEWA Mac App to find unused images and resources in Xcode project.
License: MIT License
A Mac App to find unused images and resources in Xcode project.
License: MIT License
给你点个赞!
有什么办法解决接入了R.swift的项目么
我这边有个Swift的业务模块,抽成了Pods放在了本地,请教应该怎么找到没用到的图片
My Mac systemVersion is macOS Sierrra 10.12.6,when I run the project there is a issue appear.The description is "Storyboards are not available before macOS 10.10".Then I change macOS Deployment Target as 10.12,but still appear the same issue.why?What can I do?
if imageset name is A but contains png with name B, the project will can not use name B.
So not ignore A.imageset.
Would it be possible to have an option to ignore letter case (lowercase, uppercase, etc.)?
Can't Find out the unused imageset file if the imageset filename is different from the image file in it !!!!!
在自定义bundle 中的图片怎么办
for (NSString *path in resPaths) {
NSString *name = [path lastPathComponent];
if (!name.length) {
continue;
}
NSString *keyName = [StringUtils stringByRemoveResourceSuffix:name];
if (!tempResNameInfoDict[keyName]) {
BOOL isDir = NO;
ResourceFileInfo *info = [ResourceFileInfo new];
info.name = name;
info.path = path;
info.fileSize = [FileUtils fileSizeAtPath:path isDir:&isDir];
info.isDir = isDir;
tempResNameInfoDict[keyName] = info;
}
}
这段代码中可能存在path不同但[path lastPathComponent];相同的图片,比如在不同的子工程中,后者就不会加到字典中。
The default regex "(.+?)" for .swift/.m .etc handles string like :
Checkbox(checked: true, titleSelected: "", titleNormal: "", imageSelected: UIImage(named: "cart_agree_checked"), imageNormal: UIImage(named: "cart_agree_unchecked"))
wrongly.
Suggest to use "(.*?)" instead. @tinymind
I can not get the Exclude work with my project.
I use Carthage for embedding libraries and since I do not want images from different libraries listed as unused resources, I would want to exclude that.
Thank you for your work!
In the method - (IBAction)onDeleteButtonClicked:(id)sender
[self.resultsTableView removeRowsAtIndexes:indexSet withAnimation:NSTableViewAnimationSlideUp];
might be crash. Off the top of my head, it happens a lot when the picture is not in the images.xassets
I have false positives because of .realm files and because I have in my project a complex concatenating algorithm:
title_subtitle_category1
But I guess for that - no tool could do a great job.
Thank you,
图片在plist文件的二级目录中,却被认为是没有使用过。
如果我的代码被注释掉了,比如说
// UIImage *image = [UIImage imageNamed:@"test"];
这样test这个图片会算作unused吗?
👍
Any ideas on how this could be automated?
Doing checks like this on every build in Xcode with warning messages etc might be overkill and a performance hog, but maybe if this were a command line tool or would be usable as an action in Fastlane. The action could have settings to allow builds to fail or just generate warnings about unused assets.
My app references images for 3D Touch shortcut options in the Plist
ie for the property
UIApplicationShortcutItemIconFile
Those images came back as not used in this app, but they indeed are used. Great app btw.
Maybe this has been dealt with before, but it seems that commented out code causes an image to be deemed used. Not sure if feature or not.
我收索到的图片还使用呢,结果也收索出来了
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:
swiftgen images "$PROJECT_DIR/appname/Assets.xcassets" -t swift3 \
--output "$PROJECT_DIR/appname/Constants/Images.swift"
If LSUnusedResources had access to Images.swift it would have the mapping between image filename and code Asset.imageName:
enum Asset: String {
case bgBluetooth = "bg-bluetooth"
case addFab = "add_fab"
case arrowRight = "arrow_right"
case batteryLow = "battery_low"
....
And then LSUnusedResources could search the source code for "Asset." and then for one of image names.
如果图片资源名称都是[email protected],但代码中使用的名称是xxx,搜索结果会说[email protected]未被使用
[email protected] 和 test@3x 只能搜出来一个
删除 [email protected] 再次搜索才能搜索到 [email protected]
My app has the night mode, it will automatically find the image name with the suffix "_night" when the user opens night mode.
So how to ignore these images?
你好,我们应用有夜间模式,会自动找到带有 "_night" 的图片而不是写在源代码中,这导致大量 "_night" 的非预期结果出现,使得无法正常筛选排除无用图片,有没有什么方法可以忽略特定后缀的图片呢?或者应该改进源代码的功能?
the images not show if it's extension .pdf in*.xcassets
.a文件中使用到的图片会被认为未使用,能解决吗
你好 大神 运行代码确实好用 但是有很大的误差 比如图片资源名称都是[email protected],但代码中使用的名称是xxx,搜索结果会说[email protected]未被使用,这种问题怎么去解决呢? 望大神指教一下
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.