Giter VIP home page Giter VIP logo

checkimages's Introduction

CheckImages

Command Line Tool that enables xcode build phase to check the images in your Assets folder and the images used in storyboards, xib and code.

Usage

Important:

Your project MUST have an enum that references ALL your image names. The tool will scan your enum to check the images in your project. Otherwise, it's almost impossible to determinate what images that you use.

Here is a example that you could use to create your own enum:

enum Images: String {
  case smile = "icon_smile"
  case sad   = "icon_sad"
}

It can be executed at a Terminal or integrated with the Build Phase of your project.

At Terminal:

The tool uses 3 parameters to work: an image name enum, the assets directory and the code directory (the one with your xib and storyboards specifically).

Example:

./CheckImages "./Project/MyEnum.swift" "./Project/Assets.xcassets" "./Project/"

At Build Phase:

  • Copy the tool at your project's root.

  • In your project settings, navigate to Build Phase Tab and add a new Run Script Phase.

  • In the script editor, type the below code, setting it with your project values:

${SOURCE_ROOT}/CheckImages "${SOURCE_ROOT}/MyProject/MyEnum.swift" "${SOURCE_ROOT}/Project/Assets.xcassets" "${SOURCE_ROOT}/Project/"
  • Build your project.

Result

  • Images found at your project (enum and xib) but not in your Assets (you should add those images to your Assets)

AND

  • Images found at your Assets but not in your code (enum and xib) (you should remove those images from your Assets)

OR

  • Success. Everything is fine :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.