r/iOSProgramming • • 21h ago

Article I built a CLI to find unused and duplicate .xcassets images

5 Upvotes

On almost any iOS app that's been around for a couple years, `Assets.xcassets` turns into a junk drawer. Someone rips out an old screen and forgets the assets. Design hands over a tweaked icon under a slightly different name, and the old one just sits there forever.
   
nobody wants to clean it up by hand because Xcode won't warn you if an image is still used somewhere. You only find out after a build ships with a blank spot.
   
So I put together a small open-source CLI called `asset-guard` to audit `.xcassets` catalogs and optionally strip out unused `.imageset` folders before a build. It's written in Python, so you can run PR checks on a cheap Linux runner instead of burning macOS CI minutes.
   
If you have `uv` installed and want to run a read-only check on a project without installing anything permanently:
   

uvx --from git+https://github.com/nguyen-ta-cuong/asset-guard asset-guard audit /path/to/MyApp

A few choices I made because deleting a live image is way worse than leaving a dead one behind:

  • Reference scanning leans conservative on purpose. It checks Swift and Obj-C string literals (with comments stripped), dynamic patterns like "icon_\(i)" and @"icon_%d", Xcode
  15+ generated symbols (Image(.logo), UIImage.logo), plus storyboards, XIBs, and plists. It also picks up multiple .xcassets catalogs across targets and local packages while
  skipping Pods, .build, DerivedData, and Carthage.
  • clean is a dry run by default. Passing --apply deletes whole .imageset folders, and it refuses to run if your catalogs have uncommitted git changes so you can always revert.
  • Byte-identical duplicates (matched via SHA-256) are flagged and can fail CI with --fail-on duplicates, though clean will never auto-delete them. Removing a duplicate safely
  means rewriting code references, and I didn't want a pre-build script silently touching source files.
  • It also flags broken image sets like bad Contents.json files and missing 2x, 3x scales.

A couple honest caveats right now. It only scans .imageset folders (.colorset and .symbolset aren't supported yet), and duplicate matching is byte-exact so visually identical re-exported PNGs won't show up. Also, if your app pulls asset names from a server or builds them with + concatenation, you'll need to put globs for those into .asset-guard.toml.

Repo (MIT licensed, includes a GitHub Action and Jenkinsfile example): https://github.com/nguyen-ta-cuong/asset-guard

If you've got an older Xcode project lying around, I'd love to see if audit throws any false positives on your setup. How are you all keeping .xcassets under control right now, or do dead images mostly just sit in the repo?

If you enjoy it, would you mind giving the repo a star? Thanks so much!


r/iOSProgramming • • 15h ago

Article App Store review times in 2026: Apple vs Google Play

Thumbnail
bitrise.io
4 Upvotes

r/iOSProgramming • • 11h ago

Question Help me make sense of these onboarding numbers

2 Upvotes

Doing some early end of month analysis for November.
I've had 243 users install the app but only 78 of those users complete onboarding. I'm looking at this from two angles.

  1. My app's onboarding experience gives the user a peek into what the app contains. So from this perspective onboarding serves as a good filter that will just turn away users who aren't really aligned with the flow of my app. Keep onboarding as is.
  2. It's too tedious / boring and it's just making me lose users. Refine the onboarding experience.

What a conflicting state to be in! Have others encountered this same thing? How did you approach it?

Edit: spelling


r/iOSProgramming • • 13h ago

Question How do some apps access battery details of AirPods

2 Upvotes

Title basically says everything.

I could only find a private but not public API to access battery details of AirPods in my own App.

However update submission using private APIs will be refused by Apple due to guidance 2.5.1

Does anyone know how other Apps in AppStore do it or do they maybe just use private and are lucky in review?


r/iOSProgramming • • 20h ago

Question How to add IAP back on review resubmit after rejection?

Post image
2 Upvotes

I got rejected for having the same icon for my in app purchase as my game. I couldnt edit the in app purchase so I thought I'll remove it which gave it status developer rejected and add it back. Now when I got to add it back I get this error message.

Is there any way to fix this IAP so I can resubmit it with the review again?


r/iOSProgramming • • 20h ago

Tutorial Building apps is a system design exercise

Thumbnail
blog.jacobstechtavern.com
1 Upvotes