简体   繁体   中英

Validate resources and generate getter code for iOS app in Xcode

I'm looking for a tool that can validate my images and fonts in a iOS application.

Problem:

We have a lot of different images and fonts in our application. Sometimes some of those files are replaced or renamed. We don't get compile warnings or errors just missing images scattered around the app.

I guess this is part of Objective C dynamic nature but I would really like some static check here.

Does there exist any tools that can validate content or autogenerate getter code? (preferable open source)

Thanks!

warning: Shameless self promovation ahead:

We have created a tool, IDAssetManager, (not open source, however), that creates a static interface to resources. This tool integrates heavily with Xcode. It manages and organizes resources, and generates a class with getter code for images, font and colors.

It also comes with a Xcode plugin that allow you to preview images directly from the Xcode codeview:

在此输入图像描述

The tool will also register fonts in the info.plist file.

To get the kind of validation you are looking for you will have to:

  1. Add all images to IDAsssetManager
  2. Use the getter code generated by the tool
  3. Hit the refresh button on the tool.

You will now get compile warnings for all missing resources.

You can try it here: https://itunes.apple.com/us/app/idassetmanager-lite-for-xcode/id830464758?mt=12

Edit

You can see a video of the tool in action here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM