Skip to content

danabeknar/taza

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taza 🧼

Swift @beknar

Trivial command-line tool build in educational purposes & for personal use.
Allows to easily find unused resources in XCode project.

How it works

  1. A script looks for images. For now it supports 4 types: .pdf, .png, .img, .jpg;
  2. It finds image-containable file. There are 4 types as well: .swift, .m, .xib, .storyboard;
  3. Then it loops through images and files, checking if a file contains an image. The checking depends on the file extension:
  • If it's .swift file, the script searches UIImage(named: "imageName") & UIImage(named: "imageName.extension") occurences;
  • If it's .m file, the script searches [UIImage imageNamed:@"imageName"] & [UIImage imageNamed:@"imageName.extension"] occurences;
  • If it's .xib/.storyboard file, the script searches image="imageName" & image="imageName.extension" occurences;
  1. If the script could find unused image in these files, it prints them in a good-looking way: Result

Installation

The easiest way to install Taza is using Swift Package Manager:

$ git clone https://github.com/danabeknar/taza
$ cd taza
$ swift build --configuration release
$ cp -f .build/release/taza /usr/local/bin/taza

Usage

Without any specifications (have to be executed in the directory where Xcode project is located):

taza

Specifies path of project to search for:

taza --path ~/Example

Specifies should script list all found files:

taza --listFiles

Specifies should script list all found resources:

taza --listResources

Or altogether:

taza --path ~/Example --listFiles --listResources

To Do:

  • Search specific directory
  • List files
  • List resources
  • Ignore pods
  • Removing images

Dependencies

Help, feedback or suggestions?

Feel free to contact me on Telegram for discussions, news & announcements about Taza & other projects.