skip to Main Content

How to identify quick way the Assets added inside Assets.xcassets for Images & color are using inside project or not.

Example:

int value = 10

In this case int value not used inside application which give an warning.

Initialization of immutable value 'value' was never used; consider replacing with assignment to '_' or removing it

What if inside Assets.xcassets added color or image are not used how to identify ?

2

Answers


  1. There’s no way a tool can know which assets are not being used by your application.

    Imagine that you are creating a Weather app, and the data you receive from the server includes the image_key that you use to know which asset to load.

    If a tool to find unused assets was used, it would tell you that every image or color that is not referenced directly is not used, which would yield a LOT of false positives.

    Login or Signup to reply.
  2. Xcode has no tool which could highlight not used assets but there is a open source project called "AssetsChecker" which will do the job.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search